How do I specify more than one parameter for my HyperlinkColumn?
================================================================
Many times will developing the applications we come accross the thing that how i can pass more then one parameter in the query string which is genertated by the datagrid or gridviews... once i was developing an application and the same problem came accross at that time i was quite new to ASP.net and was stucked there did lots of googleing and found the answer now today i want to share that piece of code as an example may be i may help you to avoid a bit burdden of yours to find the code
Here i have encoded the querstring or the URL to avoid some unwanted error which are normaly genertaed due to spaces and special characters.
the code follows like
[code]
< asp:DataGrid id="DataGrid1" runat="server" AutoGenerateColumns="False" >
< Columns >
< asp:TemplateColumn HeaderText="Sample Column" >
< ItemTemplate >
< asp:Hyperlink runat="server" Text=' < %#Container.DataItem("TextVal")% >' NavigateUrl=' < %# "page.aspx?Param1=" & Server.UrlEncode(Container.DataItem("Val1")) & "&Param2=" & Server.UrlEncode(Container.DataItem("Val2"))%>'/>
</itemtemplate >
</asp:TemplateColumn >
</columns >
[/code]
Thanks and regards
Meetu Choudhary
Subscribe to:
Post Comments (Atom)
Subscribe via email
MSDotnetMentor
MSDotnetMentor
My Website
http://msdotnetmentor.com
Author
Blog Archive
-
▼
2009
(53)
-
▼
June
(10)
- Empty the Recycle Bin
- Move Cursor to the Last Index in The Texbox
- Showing Image Dynamically
- Encrypt And Decrypt Using Digital Signatures
- How do I specify more than one parameter for my Hy...
- Shortcut Keys of Edit Menu in VS 2008
- Organize Usings
- Format document
- Accessing the properties of a digital signature
- Open Certificate Stores Including Certificates in ...
-
▼
June
(10)
No comments:
Post a Comment