brgdotnet
asked on
Need help with building query string
I have a hyplerlink below which I create in C#. I am redirecting to an asp.net page and sending "Id" in the query string. I can hard
code it as shown below in my current example. However I need to pass in a string for the value of 3 instead of hard coding it.
I can't figure out how to build my string. Look at the code below labeled "Desired". Can someone show me how to correctly quote my
value for MyNumber so that it is passed into the query string?
// Current
HyperLink link = new HyperLink();
link.NavigateUrl = "javascript:window.ShowMod alDialog(' \\MyPage.a spx?Id=3' " + "," + " ' MyLink ' ", 'resizeable=no,width=300,h eight=300' );void(0); "
// Desired
string MyNumber = 3;
HyperLink link = new HyperLink();
link.NavigateUrl = "javascript:window.ShowMod alDialog(' \\MyPage.a spx?Id=' " + MyNumber + "," + " ' MyLink ' ", 'resizeable=no,width=300,h eight=300' );void(0); "
code it as shown below in my current example. However I need to pass in a string for the value of 3 instead of hard coding it.
I can't figure out how to build my string. Look at the code below labeled "Desired". Can someone show me how to correctly quote my
value for MyNumber so that it is passed into the query string?
// Current
HyperLink link = new HyperLink();
link.NavigateUrl = "javascript:window.ShowMod
// Desired
string MyNumber = 3;
HyperLink link = new HyperLink();
link.NavigateUrl = "javascript:window.ShowMod
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER