Click here to Skip to main content
16,013,322 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: different between session and context Pin
N a v a n e e t h28-May-07 21:37
N a v a n e e t h28-May-07 21:37 
Questionhow to take portion of value Pin
harithadotnet28-May-07 20:58
harithadotnet28-May-07 20:58 
AnswerRe: how to take portion of value Pin
Russell Jones28-May-07 21:10
Russell Jones28-May-07 21:10 
AnswerRe: how to take portion of value Pin
kvijayajyothy28-May-07 21:26
kvijayajyothy28-May-07 21:26 
QuestionHow to use oracle procedure in asp.net. Pin
kvijayajyothy28-May-07 20:47
kvijayajyothy28-May-07 20:47 
AnswerRe: How to use oracle procedure in asp.net. Pin
Christian Graus28-May-07 23:21
protectorChristian Graus28-May-07 23:21 
Questionquerystring in datalist template. + asp.net2.0 +c# Pin
regin28-May-07 20:41
regin28-May-07 20:41 
AnswerRe: querystring in datalist template. + asp.net2.0 +c# Pin
Chetan Ranpariya28-May-07 21:54
Chetan Ranpariya28-May-07 21:54 
Hi,

I could not find any direct way to do this.
But u can use ItemDataBound event of datalist.

U need to put hyperlink in datalist ItemTemplate without setting its NavigateUrl property.
This property u can set at runtime while datalist it bound to the datasource.

Your hyperlink should be like following.

<asp:HyperLink ID="HyperLink1" runat="server"></asp:HyperLink>

I have put one label control which will have the value which we want make querystring.
I have set its visible property = false;
<asp:Label ID="lblusernamehidden" runat="server" Text='<%# Eval("username") %>' Visible="false"></asp:Label>

now I am setting hyperlink's navigateurl property in ItemDataBound event of datalist.

protected void dlst_ItemDataBound ( object sender, DataListItemEventArgs e )
{
HyperLink hl = ( HyperLink )e.Item.FindControl( "HyperLink1" );
Label lbl = ( Label )e.Item.FindControl( "lblusernamehidden" );
if ( hl != null && lbl != null )
{
hl.NavigateUrl = "~/TargetPage.aspx?username=" + lbl.Text;
}
}

this way you can get querystring dynamically in hyperlink.
also set Datalist's OnItemDataBound property to "dlst_ItemDataBound".

I hope this will help you.


Thanks and Regards,
Chetan Ranpariya
GeneralRe: querystring in datalist template. + asp.net2.0 +c# Pin
regin29-May-07 0:23
regin29-May-07 0:23 
Questiongridview + javascripting Pin
ritu432128-May-07 20:38
ritu432128-May-07 20:38 
AnswerRe: gridview + javascripting Pin
Russell Jones28-May-07 21:13
Russell Jones28-May-07 21:13 
QuestionHow to get form id in javascript function? Pin
Guru_yogi28-May-07 20:23
Guru_yogi28-May-07 20:23 
AnswerRe: How to get form id in javascript function? Pin
Saifi Hasan28-May-07 23:22
Saifi Hasan28-May-07 23:22 
QuestionASP.NET Pin
.NET- India 28-May-07 20:20
.NET- India 28-May-07 20:20 
AnswerRe: ASP.NET Pin
N a v a n e e t h28-May-07 20:38
N a v a n e e t h28-May-07 20:38 
AnswerRe: ASP.NET Pin
Amit Sk Sharma28-May-07 21:21
Amit Sk Sharma28-May-07 21:21 
AnswerRe: ASP.NET Pin
Christian Graus28-May-07 23:28
protectorChristian Graus28-May-07 23:28 
Questionhow to do update Pin
kvijayajyothy28-May-07 20:09
kvijayajyothy28-May-07 20:09 
AnswerRe: how to do update Pin
SimulationofSai28-May-07 20:13
SimulationofSai28-May-07 20:13 
QuestionAll Contents in page are not coming on print paper Pin
pjc*28-May-07 20:05
pjc*28-May-07 20:05 
AnswerRe: All Contents in page are not coming on print paper Pin
SimulationofSai28-May-07 20:10
SimulationofSai28-May-07 20:10 
QuestionType is not resolved for member - CSLA.Security.BusinessPrincipal Exception Pin
JagaSoft28-May-07 19:51
JagaSoft28-May-07 19:51 
Questionhow to access listbox items filled by javascript, on code behind Pin
Amit Sk Sharma28-May-07 19:48
Amit Sk Sharma28-May-07 19:48 
AnswerRe: how to access listbox items filled by javascript, on code behind Pin
ash0428-May-07 20:20
ash0428-May-07 20:20 
QuestionInvalid postback or callback argument. Event validation is enabled using in configuration ...... Pin
vijay258328-May-07 19:32
vijay258328-May-07 19:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.