Saturday, November 7, 2009

Visual Studio 2010 New Features:Zooming and highlighting tags.

As i am using visual studio 2010 more and more i loving it more. While working with new Microsoft New Visual Studio 2010 Express edition I have came across about two more cool features zooming feature and another the highlighting start and end tag of particular selected tag.

Let see one by one. First feature is the new zooming feature of visual studio 2010 now you can zoom your html and server side code up to 20% to 400%. This feature is very useful when you are teaching some one some thing with your code. Another thing you can also make visible your lots of code in one screen while you set it less then 100%. There is a dropdown given in both source view of html code from which you can zoom it up to 400% like as following.

Zoom1

So you can zoom your code and view in the bigger way like following.zoom2

Same way you can do it for the server side code also.

Another feature i have came across is the highlighting of start and end tag in html source view. So user can have idea where the tag can be finish. As you can see in following picture I have selected link button and its highlighting both start and end tag of link button.

Highlight

Technorati Tags: ,
Shout it
Share:

page_load event firing twice in firefox with asp.net page or user control.

Technorati Tags: ,,

We are having a very large project in asp.net 3.5. During code review of project we have found that page_load event of one control is firing twice in the firefox browser. After doing some debugging i have found that it's due to one of the link button which is there in the control. I like to share you the same scenario with you all guys.

One of the developer from us has specified the link button click event  two times.  The first one in directly in the html with onclick  like following.



Code Snippet



  1. <form id="form1" runat="server">
  2.     <div>
  3.         <asp:LinkButton ID="lnkButton" runat="server" onclick="lnkButton_Click"></asp:LinkButton>
  4.     </div>
  5.     </form>




And another in the initialize event he has also attached the event handler for the click event like following.



Code Snippet



  1. protected override void OnInit(EventArgs e)
  2.         {
  3.             lnkButton.Click += new EventHandler(lnkButton_Click);    
  4.             base.OnInit(e);
  5.         }




So i have removed one of them from initialize event and now its calling page_load event only one time. This is also responsible for the failed to load ViewState error some time when you are adding controls dynamically.

Happy programming...

Shout it
Share:
Friday, November 6, 2009

File upload control is not working with Update panel

We all are using update panel for the Ajax implementation in every site. Nowadays Ajax is almost there in each and every site. Update panel is working fine with the all other controls but when we use the file upload control then its not working fine. I have searched from lots for this and i have found one of simple solution from the Imran's blog. It is so simple and works very well. You just need to add the "multipart/form-data" attribute to the form.

Here is the link from which you can have all the information.

http://knowledgebaseworld.blogspot.com/2009/02/file-upload-not-working-with-update.html

Thanks Imran for posting nice info like this.

Shout it
Share:

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews