473,473 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

QueryString Problem

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
9 1635
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Arpan | last post by:
A link has the following URL: <a href="Page1.asp?cname=<%= Request.QueryString("cname") %>&cadd1=<%= Request.QueryString("cadd1") %>&cadd2=<%= Request.QueryString("cadd2") %>&cplace=<%=...
2
by: Mikael | last post by:
Hi All! I have a problem here and i can't see what it is... My parameters (value) are shopped off. exampe "Hello world" will end up like "hello" How should i adjust the syntax to get a whole...
1
by: lion | last post by:
my Problem: a query string passed into a html page doesn't display correctly on a mac I am just using html and javascript (no ASP, PHP or server side scripting) This is the query string:...
0
by: Matt Howeson | last post by:
Some time ago I posted a request for help with a problem I was having sometime ago whereby a 404 error would result if any access to the Querystring had been made before the Context.Rewritepath is...
4
by: Raterus | last post by:
Howdy, Simple question, but I can't figure out how to do it. I have a a page which is called initially with a querystring. After I get the querystring values, I don't need the querystring to...
12
by: Alex | last post by:
I have a question about determining if one QueryString keys exists. The idea is, if this key exists, than its presence is enough to indicate that its value is true. For example ... ...
9
by: VancouverMike | last post by:
Hi there, I run into a very strange problem. I got the following url and am passing information via query string. The problem when the "sin" key in query string is blank, shown as in the...
0
by: mohaaron | last post by:
Hello all, I'm having a problem using the ReturnUrl parameter while using FormsAuthentication. If I already have some querystring parameters in the url like this. ...
4
by: =?Utf-8?B?RVcgTmV3Ymll?= | last post by:
My apologies in advance if there is a better forum for this question. Given the following snippet: <script type="text/c#" runat="server"> protected void Page_Load(Object Sender, EventArgs e)...
2
by: zman77 | last post by:
I have a problem with HttpRequest.QueryString. There is an XML string that contains something like the following: <age>8+</age> As you probably guessed, the "+" is the problem :) I want to get...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.