Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #41 (permalink)  
Old April 10th, 2007, 05:56 PM
Friend of Wrox
 
Join Date: Aug 2006
Location: , , .
Posts: 131
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kherrerab Send a message via Yahoo to kherrerab
Default

i forgot to mention the suscribe to this topic option.

  #42 (permalink)  
Old April 11th, 2007, 10:32 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: , , .
Posts: 131
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kherrerab Send a message via Yahoo to kherrerab
Default

i just made all the mods of this forum on www.clubvwnica.com but with images.

check it www.clubvwnica.com

  #43 (permalink)  
Old April 16th, 2007, 07:49 AM
Authorized User
 
Join Date: Mar 2007
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Choice avatar with loading on server if to whom will be necessary

UserProfile.ascx

<asp:FileUpload ID="filUpload" runat="server" />&nbsp;
<asp:Button ID="btnUpload" runat="server" OnClick="btnUpload_Click" Text="Add" CausesValidation="false" />

UserProfile.ascx.cs

       protected void btnUpload_Click(object sender, EventArgs e)
       {
           lblFeedbackKO.Visible = false;
           lblFeedbackOK.Visible = false;
           if (filUpload.PostedFile != null && filUpload.PostedFile.ContentLength > 0 && filUpload.PostedFile.FileName != string.Empty)
           {
               try
               {
                   // if not already present, create a directory named /Uploads/<CurrentUserName>
                   string dirUrl = (this.Page as MB.TheBeerHouse.UI.BasePage).BaseUrl +
                      "Uploads/" + this.Page.User.Identity.Name;
                   string dirPath = Server.MapPath(dirUrl);
                   if (!Directory.Exists(dirPath))
                       Directory.CreateDirectory(dirPath);
                   // save the file under the user's personal folder
                   string fileUrl = dirUrl + "/" + Path.GetFileName(filUpload.PostedFile.FileName);
                   string _inputFile = fileUrl;
                   string contentType = filUpload.PostedFile.ContentType;
                   int contentLength = filUpload.PostedFile.ContentLength;

                   if (contentType != "image/pjpeg" && contentType != "image/gif" && contentType != "image/jpeg" && contentType != "image/x-png")
                      {
                          lblFeedbackKO.Visible = true;
                          lblFeedbackKO.Text = "Only GIF, JPEG and PNG image types are supported.";

                      }
                   else

                          if (contentLength > 25000)
                          {
                              lblFeedbackKO.Visible = true;
                              lblFeedbackKO.Text = "Avatar images must be less than 25K in size.";

                          }
                          else
                          {
                              System.Drawing.Image image = System.Drawing.Image.FromStream(filUpload.PostedFi le.InputStream);
                              if (!((image.Width > 0 && image.Width <= 100) && (image.Height > 0 && image.Height <= 100)))
                              {
                                  lblFeedbackKO.Visible = true;
                                  lblFeedbackKO.Text = "Avatar images must be no larger than 150 by 150 pixels.";

                              }
                              else
                              {
                                  filUpload.PostedFile.SaveAs(Server.MapPath(fileUrl ));
                                  txtAvatarUrl.Text = fileUrl;
                                  lblFeedbackOK.Visible = true;
                                  lblFeedbackOK.Text = "File is successfully added.<br /> For change necessary to save profile.";
                              }
                          }

                  }

               catch (Exception ex)
               {
                   lblFeedbackKO.Visible = true;
                   lblFeedbackKO.Text = ex.Message;
               }
           }
       }


  #44 (permalink)  
Old April 16th, 2007, 11:08 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: , , .
Posts: 131
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kherrerab Send a message via Yahoo to kherrerab
Default

it would be also great to limit the size of the avatar in the forum to a maximun height and with at run time when the user types the link of an avatar from someplace else.

  #45 (permalink)  
Old May 2nd, 2007, 03:02 PM
Friend of Wrox
 
Join Date: Aug 2006
Location: , , .
Posts: 142
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to vantoko
Default

Hi Jimi,

can you add in your readme that you should update the posts table in the priority list (set it to 0 ? (if not you get a cast error).
I also saw on your site that you added categories to the forum. did you put that code online?

koen

  #46 (permalink)  
Old May 3rd, 2007, 02:36 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

Quote:
quote:Originally posted by vantoko
 Hi Jimi,

can you add in your readme that you should update the posts table in the priority list (set it to 0 ? (if not you get a cast error).
I also saw on your site that you added categories to the forum. did you put that code online?

koen

vantoko,

i'll update the readme.txt file as you suggest.

the categories stuff on my site is actually related to some enhanced functionality that i'm doing for a site (which will be called the gifted geezer) - i'm afraid that that code to integrate categories into the forums is quite a departure from what had been done on the previous simple cut that i put into the archive. i'm not sure how easy it'd be to extract the logic at this point (i'm actually actively working on the site now). i'll take a look but of the top of my head feel that it may be something that would divert me from the task that i've got to complete (plan to go live 4th june).

as they say, never say never!!

jimi

http://www.jamestollan.com
  #47 (permalink)  
Old May 3rd, 2007, 02:06 PM
Friend of Wrox
 
Join Date: Aug 2006
Location: , , .
Posts: 142
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to vantoko
Default

no problem. good luck with the gifted geezer :)

  #48 (permalink)  
Old May 3rd, 2007, 03:45 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

Quote:
quote:Originally posted by vantoko
 no problem. good luck with the gifted geezer :)

yes, it'll be interesting. a site comprised of mega-ego individuals all vying for some sort of etherial #1 position... yep, room for a bit of manipulation for fun there methinks!! :)

oh, btw - i found an issue on your site when clicking on the dropdown on this page:

http://www.skistyle.be/BrowseThreads.aspx?ForumID=1

basically, the initial click on the dropdown errors out - trying to think if it's a double postback going on, not sure. anyway, just thought i'd mention in case you hadn't seen it. likewise, i'd appreciate any debug/error reports on the site at www.jamestollan.com (my testbed site for new stuff) in the coming weeks. i'll announce when it's in beta (at that stage, there won't be any testing of styling etc, just the functionality).

jimi

btw - i did attempt to switch to your search routines last week (they are devlishly simple but effective and tight). however, even tho' i switched full text search on, i kept getting darned issues. i'll let you know when it's resolved. but needless to say, i think your search pattern is far supperior to mine, which focusses on each componenet part (posts/articles/homepages/have your says). i like the idea of a generic search page that returns urls to disparate functions and will emulate it once i've got the full text b*llocks working correctly.

anyway - must get on

jimi



jimi

http://www.jamestollan.com
  #49 (permalink)  
Old May 4th, 2007, 12:32 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: , , .
Posts: 142
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to vantoko
Default

thanks for the feedback. I'll have a look at it.

regarding the search : if you implement my routine, make sure you create a job which executes a full text search every 10 minutes.
for some kind of reason SQL removes the queries from the cache which makes it perform very !!! slowly. Creating the job solves the issue (not the nicest solution, but it works :)

  #50 (permalink)  
Old May 9th, 2007, 04:59 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: , , .
Posts: 142
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to vantoko
Default

Hi,

I implemented the forum on my beta site and locally on my vista machine and it works fine.
However, I forgot to add ss_Posts.Priority, in my getthreads method in SQLForumsprovider.
This caused my homepage to show no threads (I have a latest threads implemented)

It caused no error locally (didn't show any threads), except on the hosting maching where CPU went up to 100% .
The event viewer showed this info (I stripped some):

An unhandled exception has occurred.

Exception information:

    Exception type: IndexOutOfRangeException

    Exception message: Priority

    Request URL: http://mybetasite/GetThreadsRss.aspx...r=LastPostDate DESC&AspxAutoDetectCookieSupport=1

    Request path: /GetThreadsRss.aspx

It seems normal to me that this exception is thrown when the SQL statement is wrong, but I cannot understand why locally the application skips the error and continues to run and on the server my CPU goes up to 100%
Is this something with this forum extension, is this an error in the TBH code, ..... ??

all tips welcome

Koen


 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX Extensions ilegend .NET Framework 3.5 1 September 19th, 2008 03:32 AM
Some Extensions plb BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 July 29th, 2008 11:57 AM
PHP Extensions Dnigma Pro PHP 0 June 22nd, 2006 12:41 AM
File Extensions nbnelson C# 2 August 25th, 2003 12:09 PM
converting Forum.aspx to Forum.ascx (help) drfunkie BOOK: ASP.NET Website Programming Problem-Design-Solution 1 July 11th, 2003 12:27 PM



All times are GMT -4. The time now is 10:39 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.