Surround with CodeSnippet feature in Visual Studio 2010

No.of Views1911
Bookmarked0 times
Downloads 
Votes0
By  jalpesh   On  06 Aug 2011 21:08:22
Tag : ASP.NET , General
Today Once again I have discovered a new feature called “Surround with” feature. This feature is quite useful when you have very big HTML element and You want to surround it some HTML or ASP.NET element
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

today Once again I have discovered a new feature called “Surround with” feature. This feature is quite useful when you have very big HTML element and You want to surround it some HTML or ASP.NET element.i.e. Suppose there is one very big div there and you want to add update panel for Ajax . So let’s take a Simple Example over there. I am having a div which contain very big HTML in it. Like following.

<div>
  Very big HTML here.
</div>

Now let's put that div into update panel with Surround with feature. You can right click and click Surround With or You can directly have shortcut Ctrl+k, Ctrl +S like following.

Image Loading

Now once you click it It will popup three things.
1) ASP.NET
2) ASP.NET MVC 2 and
3) HTML.
You can select element of any of that like following.

Image Loading

I am going select ASP.NET as we want to put Update panel over there. Once you click ASP.NET It will popup elements of asp.net. Here I have selected update panel as I want to put update panel covering this div like following.

Image Loading

Now once you click update panel it will put Update panel and div will be in content template of Update panel. Now our code will like following.

<asp:UpdatePanel runat="server">
  <ContentTemplate>
      <div>
          Very big HTML here.
      </div>
  </ContentTemplate>
</asp:UpdatePanel>

That's it. Isn't that cool?. Hope you like it.Happy Programming..

 
Sign Up to vote for this article
 
About Author
 
jalpesh
Occupation-Software Engineer
Company-DotNetJaps
Member Type-Gold
Location-India
Joined date-08 May 2010
Home Page-http://www.dotnetjalps.com
Blog Page-http://www.dotnetjalps.com
I am jalpesh vadgamaa an Microsoft MVP for Visual C# and BrainBench Certified ASP.NET Developer having experience of five year in Microsoft .NET Technology.I am working as Project Leader in Mid Size company.My work area comprises of Enterprise Level projects using ASP.NET and other Microsoft .NET Technologies.Please feel free to contact me for any queries via posting comments on my blog I will try to reply as early as possible.
 
 
Other popularSectionarticles
    In visual studio 2008 nested master page concept is introduced, to make page template
    Published Date : 16/Feb/2010
    The problem arises when you install IIS after installing ASP.NET. If you do this, IIS will configure itself for the ASP.NET version that ships with your Windows edition that might be an older version (e.g. version 2.0) and you won’t be able to run any web application built using a later version of ASP.NET.
    Published Date : 21/Jan/2011
    This is just a helper article which may help you to decide which technology you might want to go.
    Published Date : 20/Aug/2010
    This article I am going to discuss function which convert numeric value to word for that we create one web page which return convert number to word.
    Published Date : 13/Oct/2011
    Set Start Up page on Visual studio IDE
    Published Date : 02/Aug/2011
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top
</