Request.QueryString["myvar"] not displaying in webcontrol?

  • Thread starter Thread starter Nigil LaVey
  • Start date Start date
N

Nigil LaVey

hi guys,

I have tried all sort of methods but still no luck.. I just can't figure
out why I can't see the actual value from <% Request.QueryString["myvar"]%>
within the webcontrol.


<ccs:ctrl id="LoginCtrl2" runat="server">
<Session>
<ccs:Session Name='<% Request.QueryString["myvar"]%>'></ccs:Session>
</Session>
</ccs:ctrl>

pls advise,
LaVey
 
Sorry, the last one got cut off.

Have you tried <% Response.Write(Request.QueryString["myvar"].ToString());
%>
or <%= Request.QueryString["myvar"].ToString() %>
?

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
you actually should use:
<ccs:Session Name='<%# Request.QueryString["myvar"]%>'></ccs:Session>
i mean <%# %> against <%%>
 
hi all..

thanks for all the overwhelming replies...
as what I have expected.. by using DataBinding Syntax.... but I am facing
this problems..

noticed that when declaring at the root of ur webcontrol tag.. it works like
a beauty... but if I declare it within the nested class property.. it throws
me this error message

ccs.session does not contain a definition for 'DataBinding'

so I inherits the System.Web.UI.Page inside my nested class. guess what.. no
errror.... but it's not appearing.


<ccs:ctrl id="LoginCtrl2" runat="server">
<Session>
<ccs:Session Name='<%# Request.QueryString["myvar"]%>'></ccs:Session>
</Session>
</ccs:ctrl>


anyone?
regards,
LaVey

Abhijeet Dev said:
you actually should use:
<ccs:Session Name='<%# Request.QueryString["myvar"]%>'></ccs:Session>
i mean <%# %> against <%%>

Nigil LaVey said:
hi guys,

I have tried all sort of methods but still no luck.. I just can't figure
out why I can't see the actual value from <% Request.QueryString["myvar"]%>
within the webcontrol.


<ccs:ctrl id="LoginCtrl2" runat="server">
<Session>
<ccs:Session Name='<% Request.QueryString["myvar"]%>'></ccs:Session>
</Session>
</ccs:ctrl>

pls advise,
LaVey
 
I could not quite understand why do u need to inherit from
System.Web.UI.Page when its probably a web control/UserControl ... and even
simple the class Control has DataBinding defined...

Nigil LaVey said:
hi all..

thanks for all the overwhelming replies...
as what I have expected.. by using DataBinding Syntax.... but I am facing
this problems..

noticed that when declaring at the root of ur webcontrol tag.. it works like
a beauty... but if I declare it within the nested class property.. it throws
me this error message

ccs.session does not contain a definition for 'DataBinding'

so I inherits the System.Web.UI.Page inside my nested class. guess what.. no
errror.... but it's not appearing.


<ccs:ctrl id="LoginCtrl2" runat="server">
<Session>
<ccs:Session Name='<%# Request.QueryString["myvar"]%>'></ccs:Session>
</Session>
</ccs:ctrl>


anyone?
regards,
LaVey

Abhijeet Dev said:
you actually should use:
<ccs:Session Name='<%# Request.QueryString["myvar"]%>'></ccs:Session>
i mean <%# %> against <%%>

Nigil LaVey said:
hi guys,

I have tried all sort of methods but still no luck.. I just can't figure
out why I can't see the actual value from <% Request.QueryString["myvar"]%>
within the webcontrol.


<ccs:ctrl id="LoginCtrl2" runat="server">
<Session>
<ccs:Session Name='<% Request.QueryString["myvar"]%>'></ccs:Session>
</Session>
</ccs:ctrl>

pls advise,
LaVey
 
hi Abhijeet,

I have no idea though.. I thought it might solve it by inheriting
System.Web.UI.Page onto my nested class.... but it didn't. I just find it
very strange on this issue.. if a control can support databinding systnax..
why not the normal way <%=Request.QueryString["myvar"]%>

really needed to solve it... all thoughts welcome.

<ccs:ctrl id="LoginCtrl2" runat="server">
<Session>
<ccs:Session Name='<%# Request.QueryString["myvar"]%>'></ccs:Session>
</Session>
</ccs:ctrl>

Regards,
LaVey
 
Back
Top