By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,589 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

QueryString Problem

P: n/a
I want to get a parameter through quesry string and set it to a property of
a control in my page as follow but it shows me an error:

<cc1:ReportViewer id="ReportViewer1"
runat="server" Height="312px" width="712px" parameters="true"
ServerUrl="http://localhost/reportserver"
ReportPath="<%=Request.QueryString["rptPath"];%>"> <--Error occurs
here "Server tags cannot contain <% ... %> constructs"
</cc1:ReportViewer>
Nov 19 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
CMA
hi Ray,

try with this solution...

incorrect : ReportPath="<% =Request.QueryString["rptPath"];%>
correct: ReportPath="<% Request.QueryString["rptPath"];%>

just remove the "=" at the beginning.

hope this helps,
regards,
CMA
"Ray Alirezaei" <ra*@my.com> wrote in message
news:#1**************@TK2MSFTNGP09.phx.gbl...
I want to get a parameter through quesry string and set it to a property of a control in my page as follow but it shows me an error:

<cc1:ReportViewer id="ReportViewer1"
runat="server" Height="312px" width="712px" parameters="true"
ServerUrl="http://localhost/reportserver"
ReportPath="<%=Request.QueryString["rptPath"];%>"> <--Error occurs
here "Server tags cannot contain <% ... %> constructs"
</cc1:ReportViewer>

Nov 19 '05 #2

P: n/a
Ray, that's correct. You probably want to use the codebehind, and do
something like;

ReportViewer1.ReportPath = Request.QueryString["rptPath"];

in your Page_Load ().

"Ray Alirezaei" <ra*@my.com> wrote in message
news:#1**************@TK2MSFTNGP09.phx.gbl...
I want to get a parameter through quesry string and set it to a property of a control in my page as follow but it shows me an error:

<cc1:ReportViewer id="ReportViewer1"
runat="server" Height="312px" width="712px" parameters="true"
ServerUrl="http://localhost/reportserver"
ReportPath="<%=Request.QueryString["rptPath"];%>"> <--Error occurs
here "Server tags cannot contain <% ... %> constructs"
</cc1:ReportViewer>

Nov 19 '05 #3

P: n/a
Thannks for your reply
No ,I can't use code behind for some reason and I have to do it inline.
"MWells" <outbound__at_sygnal.com> wrote in message
news:eG**************@TK2MSFTNGP10.phx.gbl...
Ray, that's correct. You probably want to use the codebehind, and do
something like;

ReportViewer1.ReportPath = Request.QueryString["rptPath"];

in your Page_Load ().

"Ray Alirezaei" <ra*@my.com> wrote in message
news:#1**************@TK2MSFTNGP09.phx.gbl...
I want to get a parameter through quesry string and set it to a property

of
a control in my page as follow but it shows me an error:

<cc1:ReportViewer id="ReportViewer1"
runat="server" Height="312px" width="712px" parameters="true"
ServerUrl="http://localhost/reportserver"
ReportPath="<%=Request.QueryString["rptPath"];%>"> <--Error
occurs
here "Server tags cannot contain <% ... %> constructs"
</cc1:ReportViewer>


Nov 19 '05 #4

P: n/a
No,it dosen't work as well now it says:
Parser Error Message: Literal content ('" >') is not allowed within a
'Microsoft.Samples.ReportingServices.ReportViewer' .

Source Error:

Line 16: runat="server" Height="312px" width="712px" parameters="true"
Line 17: ServerUrl="http://localhost/reportserver"
Line 18: ReportPath="<%Request.QueryString["rptPath"];%>"
Line 19: ></cc1:ReportViewer>
Line 20: </form>

"CMA" <cm**************@textcentric.lk> wrote in message
news:OU**************@TK2MSFTNGP09.phx.gbl...
hi Ray,

try with this solution...

incorrect : ReportPath="<% =Request.QueryString["rptPath"];%>
correct: ReportPath="<% Request.QueryString["rptPath"];%>

just remove the "=" at the beginning.

hope this helps,
regards,
CMA
"Ray Alirezaei" <ra*@my.com> wrote in message
news:#1**************@TK2MSFTNGP09.phx.gbl...
I want to get a parameter through quesry string and set it to a property

of
a control in my page as follow but it shows me an error:

<cc1:ReportViewer id="ReportViewer1"
runat="server" Height="312px" width="712px" parameters="true"
ServerUrl="http://localhost/reportserver"
ReportPath="<%=Request.QueryString["rptPath"];%>"> <--Error
occurs
here "Server tags cannot contain <% ... %> constructs"
</cc1:ReportViewer>


Nov 19 '05 #5

P: n/a
The job of <%= %> is to place the content in the response stream. A server
tag doesn't go to the response stream. It goes to asp.net for processing.

Eliyahu

"Ray Alirezaei" <ra*@my.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
I want to get a parameter through quesry string and set it to a property of a control in my page as follow but it shows me an error:

<cc1:ReportViewer id="ReportViewer1"
runat="server" Height="312px" width="712px" parameters="true"
ServerUrl="http://localhost/reportserver"
ReportPath="<%=Request.QueryString["rptPath"];%>"> <--Error occurs
here "Server tags cannot contain <% ... %> constructs"
</cc1:ReportViewer>

Nov 19 '05 #6

P: n/a
You don't have to use code-behind. You can place the code on the aspx page
in a server script.

Eliyahu

"Ray Alirezaei" <ra*@my.com> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
Thannks for your reply
No ,I can't use code behind for some reason and I have to do it inline.
"MWells" <outbound__at_sygnal.com> wrote in message
news:eG**************@TK2MSFTNGP10.phx.gbl...
Ray, that's correct. You probably want to use the codebehind, and do
something like;

ReportViewer1.ReportPath = Request.QueryString["rptPath"];

in your Page_Load ().

"Ray Alirezaei" <ra*@my.com> wrote in message
news:#1**************@TK2MSFTNGP09.phx.gbl...
I want to get a parameter through quesry string and set it to a
property of
a control in my page as follow but it shows me an error:

<cc1:ReportViewer id="ReportViewer1"
runat="server" Height="312px" width="712px" parameters="true"
ServerUrl="http://localhost/reportserver"
ReportPath="<%=Request.QueryString["rptPath"];%>"> <--Error
occurs
here "Server tags cannot contain <% ... %> constructs"
</cc1:ReportViewer>



Nov 19 '05 #7

P: n/a
Do I have access to my control in a sever script?
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:uz**************@TK2MSFTNGP09.phx.gbl...
You don't have to use code-behind. You can place the code on the aspx page
in a server script.

Eliyahu

"Ray Alirezaei" <ra*@my.com> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
Thannks for your reply
No ,I can't use code behind for some reason and I have to do it inline.
"MWells" <outbound__at_sygnal.com> wrote in message
news:eG**************@TK2MSFTNGP10.phx.gbl...
Ray, that's correct. You probably want to use the codebehind, and do
something like;

ReportViewer1.ReportPath = Request.QueryString["rptPath"];

in your Page_Load ().

"Ray Alirezaei" <ra*@my.com> wrote in message
news:#1**************@TK2MSFTNGP09.phx.gbl...
> I want to get a parameter through quesry string and set it to a property of
> a control in my page as follow but it shows me an error:
>
> <cc1:ReportViewer id="ReportViewer1"
> runat="server" Height="312px" width="712px" parameters="true"
> ServerUrl="http://localhost/reportserver"
> ReportPath="<%=Request.QueryString["rptPath"];%>"> <--Error
> occurs
> here "Server tags cannot contain <% ... %> constructs"
> </cc1:ReportViewer>
>
>



Nov 19 '05 #8

P: n/a
Why not? The aspx code inherits from codebehind. It can access any public
and protected members.

Eliyahu

"ALI-R" <ne****@microsoft.com> wrote in message
news:us*************@TK2MSFTNGP12.phx.gbl...
Do I have access to my control in a sever script?
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:uz**************@TK2MSFTNGP09.phx.gbl...
You don't have to use code-behind. You can place the code on the aspx page in a server script.

Eliyahu

"Ray Alirezaei" <ra*@my.com> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
Thannks for your reply
No ,I can't use code behind for some reason and I have to do it inline. "MWells" <outbound__at_sygnal.com> wrote in message
news:eG**************@TK2MSFTNGP10.phx.gbl...
> Ray, that's correct. You probably want to use the codebehind, and do > something like;
>
> ReportViewer1.ReportPath = Request.QueryString["rptPath"];
>
> in your Page_Load ().
>
> "Ray Alirezaei" <ra*@my.com> wrote in message
> news:#1**************@TK2MSFTNGP09.phx.gbl...
>> I want to get a parameter through quesry string and set it to a

property
> of
>> a control in my page as follow but it shows me an error:
>>
>> <cc1:ReportViewer id="ReportViewer1"
>> runat="server" Height="312px" width="712px" parameters="true"
>> ServerUrl="http://localhost/reportserver"
>> ReportPath="<%=Request.QueryString["rptPath"];%>"> <--Error
>> occurs
>> here "Server tags cannot contain <% ... %> constructs"
>> </cc1:ReportViewer>
>>
>>
>
>



Nov 19 '05 #9

P: n/a
Thanks very much indeed ,I got it working now
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:eR**************@TK2MSFTNGP11.phx.gbl...
Why not? The aspx code inherits from codebehind. It can access any public
and protected members.

Eliyahu

"ALI-R" <ne****@microsoft.com> wrote in message
news:us*************@TK2MSFTNGP12.phx.gbl...
Do I have access to my control in a sever script?
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:uz**************@TK2MSFTNGP09.phx.gbl...
You don't have to use code-behind. You can place the code on the aspx page in a server script.

Eliyahu

"Ray Alirezaei" <ra*@my.com> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
> Thannks for your reply
> No ,I can't use code behind for some reason and I have to do it inline. > "MWells" <outbound__at_sygnal.com> wrote in message
> news:eG**************@TK2MSFTNGP10.phx.gbl...
> > Ray, that's correct. You probably want to use the codebehind, and do > > something like;
> >
> > ReportViewer1.ReportPath = Request.QueryString["rptPath"];
> >
> > in your Page_Load ().
> >
> > "Ray Alirezaei" <ra*@my.com> wrote in message
> > news:#1**************@TK2MSFTNGP09.phx.gbl...
> >> I want to get a parameter through quesry string and set it to a
property
> > of
> >> a control in my page as follow but it shows me an error:
> >>
> >> <cc1:ReportViewer id="ReportViewer1"
> >> runat="server" Height="312px" width="712px" parameters="true"
> >> ServerUrl="http://localhost/reportserver"
> >> ReportPath="<%=Request.QueryString["rptPath"];%>"> <--Error > >> occurs
> >> here "Server tags cannot contain <% ... %> constructs"
> >> </cc1:ReportViewer>
> >>
> >>
> >
> >
>
>



Nov 19 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.