Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Monday, March 26, 2012

Pass the selected date from a calendar in a querystring - .net 2005 b2

We are trying to pass the selected date from a .net calendar in a
querystring. We manage to display the selected date from the calendar in a
Lable like this :

protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
lblDate.Text = Calendar1.SelectedDate.ToShortDateString();
}

<asp:Label ID="lblDate" runat="server"></asp:Label
What we are trying to accomplish is to pull the above value of the lable
which is "lblDate" to the following link and pass is as a querystring

<a href='default5.aspx?tech=<%# Eval("RESPONS")
%>&today=selected_date'><span style="font-size: 10px">Link
Name</span></a><br /
thnxprotected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
lblDate.Text = Calendar1.SelectedDate.ToShortDateString();
litDate.Text = Calendar1.SelectedDate.ToShortDateString();

}

<asp:Label ID="lblDate" runat="server"></asp:Label>
<a href='default5.aspx?tech=<asp:Literal ID="litDate"
runat="server"/>amp;today=selected_date'><span style="font-size: 10px">Link
Name</span></a><br /
Or just use HyperLink WebControl and fill NavigateUrl property with correct
data.

--
C# Dev

"Chanaka" wrote:

> We are trying to pass the selected date from a .net calendar in a
> querystring. We manage to display the selected date from the calendar in a
> Lable like this :
> protected void Calendar1_SelectionChanged(object sender, EventArgs e)
> {
> lblDate.Text = Calendar1.SelectedDate.ToShortDateString();
> }
> <asp:Label ID="lblDate" runat="server"></asp:Label>
> What we are trying to accomplish is to pull the above value of the lable
> which is "lblDate" to the following link and pass is as a querystring
> <a href='default5.aspx?tech=<%# Eval("RESPONS")
> %>&today=selected_date'><span style="font-size: 10px">Link
> Name</span></a><br />
> thnx
>
>
>

pass value to image control

This is my first time to use asp.net. I just want to get an image name passed from url (by using request.querystring), and then display this image, when user click the image, I also display the mouse coordinate. But I just can not get it to work, please help. Thanks. The following is my code:

<script runat="server">
Sub getCoordinates(sender As Object, e As ImageClickEventArgs)
mess.Text="Coordinates: " & e.x & ", " & e.y
End Sub
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim imagename as String = Request.QueryString("name")
Dim imagePath as String =Server.MapPath("/keller/portrait/" & imagename)
End Sub
</script>
<html>
<body>
<form runat="server">
<p>Click on the image:</p>
<asp:Image
runat="server"
ImageUrl="<%=iamgePath%>"
OnClick="getCoordinates"/>
<p><asp:label id="mess" runat="server"/></p>
</form>
</body>
</html>
Welcome to the ASP.NET Forums, lily1.

The following update to your code will correctly show the image passed in with the QueryString.

<%@. page language="VB" debug="true" %>
<html>
<head>
<title>This is main Page</title>
<script runat="server"
Sub getCoordinates(sender As Object, e As ImageClickEventArgs)
mess.Text="Coordinates: " & e.x & ", " & e.y
End Sub

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim imagename as String = Request.QueryString("name")
Dim imagePath As String = Server.MapPath("/keller/portrait/" & imagename & ".gif")
MyImage.ImageUrl = imagePath
End Sub

</script>
<html>
<body>
<form runat="server">
<p>Click on the image:</p>
<asp:Image runat="server"
id="MyImage"
OnClick="getCoordinates" />
<p><asp:label id="mess" runat="server" /></p>
</form>
</body>
</html>

The only difference is that I gave the asp:Image control an ID, and used this ID in your Page_Load code to set its ImageUrl property.

For details of how to get your imagemap working, see the following tutorial:
ImageMap.NET

I hope this helps.
Thanks for your help. I tried your script, The picture can be displayed correctly now, but when i click the picture, I got javascript error, it seems that function 'getCoordinates' does not execute at server instead it tries to run at client side. Here is url of the page:http://user1046822.wx15.registeredsite.com/keller/imagecrop_coodinates.aspx?name=test.jpg . Could you please tell me what is the problem? Thanks again.
> Could you please tell me what is the problem?

You've defined the problem yourself ... that getCoordinates tries to run at the client-side, not at the server.

Please go through the article I provided above. That will explain how to send click coordinates back to your server-side code.

Pass values from URL to other pages ?

i have a page A and Page B.
in Page A have 2 links to Page B. to display a set of date based on
condiction set in url.. like
in page A
link1 = pageB.aspx?id=1
link2 = pageB.aspx?id=2
so when page B opens it sould get the values from the url and run a queary..
like
SELECT * FROM TABEL WHERE KEY_ID= (value got some page A)
in page B i have a Dataview bind with 'SqlDataSource' i exactly dont know to
call the valus from URL...
your thoughs much appericated !Hi ,
You can get value from Url by using Request.Querystring["id"].
Thanks
Sharmila
You can use the QueryString property of the Request: Request.QueryString["id
"].
See
[url]http://authors.aspalliance.com/aspxtreme/sys/web/httprequestclassquerystring.aspx[
/url]
Hege Servold
hege.servold(AT)bekk.no
"velu" wrote:

> i have a page A and Page B.
> in Page A have 2 links to Page B. to display a set of date based on
> condiction set in url.. like
> in page A
> link1 = pageB.aspx?id=1
> link2 = pageB.aspx?id=2
> so when page B opens it sould get the values from the url and run a queary
.
> like
> SELECT * FROM TABEL WHERE KEY_ID= (value got some page A)
> in page B i have a Dataview bind with 'SqlDataSource' i exactly dont know
to
> call the valus from URL...
> your thoughs much appericated !

Pass values from URL to other pages ?

i have a page A and Page B.

in Page A have 2 links to Page B. to display a set of date based on
condiction set in url.. like

in page A

link1 = pageB.aspx?id=1
link2 = pageB.aspx?id=2

so when page B opens it sould get the values from the url and run a queary..

like

SELECT * FROM TABEL WHERE KEY_ID= (value got some page A)

in page B i have a Dataview bind with 'SqlDataSource' i exactly dont know to
call the valus from URL...

your thoughs much appericated !Hi ,

You can get value from Url by using Request.Querystring["id"].

Thanks
Sharmila
You can use the QueryString property of the Request: Request.QueryString["id"].
See
http://authors.aspalliance.com/aspx...uerystring.aspx

--
Hege Servold
hege.servold(AT)bekk.no

"velu" wrote:

> i have a page A and Page B.
> in Page A have 2 links to Page B. to display a set of date based on
> condiction set in url.. like
> in page A
> link1 = pageB.aspx?id=1
> link2 = pageB.aspx?id=2
> so when page B opens it sould get the values from the url and run a queary..
> like
> SELECT * FROM TABEL WHERE KEY_ID= (value got some page A)
> in page B i have a Dataview bind with 'SqlDataSource' i exactly dont know to
> call the valus from URL...
> your thoughs much appericated !

Saturday, March 24, 2012

passign variables from one page to another

If I have variables that I need passed to the next page I want to display, how should I do that?
I was doing it with session variables, but I really don't need them to be part of the session, just there long enough to load the next page.
I tried hardcoding something like
Responce.Redirect("NextPage.aspx?Name="+strName);
but I don't know how to pick it up on the next page. I tried with the viewstate but It never finds it?

Can someone explain to me, or pont to an article how I should be doing this..
ThanksIf you did want to take the querystring approach (i.e. "nextpage.aspx?name=....") then you can retrieve your values out of the querystring like so:

Dim strName As String = Request.QueryString("Name")

Storing your values in ViewState won't help you on the next page because ViewState is a page-by-page storage medium, not a page-to-page storage medium.
Ok thanks, Is the queryString approach generally the most common used? What other ways are there to do this?

Wednesday, March 21, 2012

Passing a javascript array to a handler .ashx

I am using a handler (processImage.ashx) to display an image. The image is
displayed according to parameters passed in the querystring. The handerl is
called via some clientside javascript.
I want to send an array of unknown length to the handler. I am not sure
whether the querystring is the best place to do this. What's the best way to
send an array held in the client side javascript to the handler?
Thanks in advance,
JJyou can not post an image request, so the url is the only option other than
a
prelimary ajax call. the url is restricted to about 2k. how you encode the
array depends on the array type. the most common is a array.join('|'), with
a
matching split on the server side.
-- bruce (sqlwork.com)
"JJ" wrote:

> I am using a handler (processImage.ashx) to display an image. The image is
> displayed according to parameters passed in the querystring. The handerl i
s
> called via some clientside javascript.
> I want to send an array of unknown length to the handler. I am not sure
> whether the querystring is the best place to do this. What's the best way
to
> send an array held in the client side javascript to the handler?
> Thanks in advance,
> JJ
>
>
How would I do the prelimary ajax call?
Thanks,
JJ
"bruce barker (sqlwork.com)"
<brucebarkersqlworkcom@.discussions.microsoft.com> wrote in message
news:C8495134-FF6B-4D8B-82C1-FE5F393D6454@.microsoft.com...
> you can not post an image request, so the url is the only option other
> than a
> prelimary ajax call. the url is restricted to about 2k. how you encode the
> array depends on the array type. the most common is a array.join('|'),
> with a
> matching split on the server side.
> -- bruce (sqlwork.com)
>
> "JJ" wrote:
>
Hi JJ,
I think Bruce means you should pass the image urls(or any array parameters)
either through url querystring or through AJAX xmlhttp request. Directly
manipulate binary content of image is not quite supported in client script
and also not effecient to pass such large content frequently.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--
>From: "JJ" <abc@.xyz.com>
>Subject: Re: Passing a javascript array to a handler .ashx
>Date: Tue, 20 Nov 2007 10:55:18 -0000

>How would I do the prelimary ajax call?
>Thanks,
>JJ
>"bruce barker (sqlwork.com)"
><brucebarkersqlworkcom@.discussions.microsoft.com> wrote in message
>news:C8495134-FF6B-4D8B-82C1-FE5F393D6454@.microsoft.com...
the
handerl
way
>
>

Passing a javascript array to a handler .ashx

I am using a handler (processImage.ashx) to display an image. The image is
displayed according to parameters passed in the querystring. The handerl is
called via some clientside javascript.

I want to send an array of unknown length to the handler. I am not sure
whether the querystring is the best place to do this. What's the best way to
send an array held in the client side javascript to the handler?

Thanks in advance,
JJyou can not post an image request, so the url is the only option other than a
prelimary ajax call. the url is restricted to about 2k. how you encode the
array depends on the array type. the most common is a array.join('|'), with a
matching split on the server side.

-- bruce (sqlwork.com)

"JJ" wrote:

Quote:

Originally Posted by

I am using a handler (processImage.ashx) to display an image. The image is
displayed according to parameters passed in the querystring. The handerl is
called via some clientside javascript.
>
I want to send an array of unknown length to the handler. I am not sure
whether the querystring is the best place to do this. What's the best way to
send an array held in the client side javascript to the handler?
>
Thanks in advance,
JJ
>
>
>


How would I do the prelimary ajax call?

Thanks,
JJ
"bruce barker (sqlwork.com)"
<brucebarkersqlworkcom@.discussions.microsoft.comwro te in message
news:C8495134-FF6B-4D8B-82C1-FE5F393D6454@.microsoft.com...

Quote:

Originally Posted by

you can not post an image request, so the url is the only option other
than a
prelimary ajax call. the url is restricted to about 2k. how you encode the
array depends on the array type. the most common is a array.join('|'),
with a
matching split on the server side.
>
-- bruce (sqlwork.com)
>
>
"JJ" wrote:
>

Quote:

Originally Posted by

>I am using a handler (processImage.ashx) to display an image. The image
>is
>displayed according to parameters passed in the querystring. The handerl
>is
>called via some clientside javascript.
>>
>I want to send an array of unknown length to the handler. I am not sure
>whether the querystring is the best place to do this. What's the best way
>to
>send an array held in the client side javascript to the handler?
>>
>Thanks in advance,
>JJ
>>
>>
>>


Hi JJ,

I think Bruce means you should pass the image urls(or any array parameters)
either through url querystring or through AJAX xmlhttp request. Directly
manipulate binary content of image is not quite supported in client script
and also not effecient to pass such large content frequently.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

-------

Quote:

Originally Posted by

>From: "JJ" <abc@.xyz.com>
>Subject: Re: Passing a javascript array to a handler .ashx
>Date: Tue, 20 Nov 2007 10:55:18 -0000


Quote:

Originally Posted by

>How would I do the prelimary ajax call?
>
>Thanks,
>JJ
>"bruce barker (sqlwork.com)"
><brucebarkersqlworkcom@.discussions.microsoft.comwro te in message
>news:C8495134-FF6B-4D8B-82C1-FE5F393D6454@.microsoft.com...

Quote:

Originally Posted by

>you can not post an image request, so the url is the only option other
>than a
>prelimary ajax call. the url is restricted to about 2k. how you encode


the

Quote:

Originally Posted by

Quote:

Originally Posted by

>array depends on the array type. the most common is a array.join('|'),
>with a
>matching split on the server side.
>>
>-- bruce (sqlwork.com)
>>
>>
>"JJ" wrote:
>>

Quote:

Originally Posted by

>>I am using a handler (processImage.ashx) to display an image. The image
>>is
>>displayed according to parameters passed in the querystring. The


handerl

Quote:

Originally Posted by

Quote:

Originally Posted by

Quote:

Originally Posted by

>>is
>>called via some clientside javascript.
>>>
>>I want to send an array of unknown length to the handler. I am not sure
>>whether the querystring is the best place to do this. What's the best


way

Quote:

Originally Posted by

Quote:

Originally Posted by

Quote:

Originally Posted by

>>to
>>send an array held in the client side javascript to the handler?
>>>
>>Thanks in advance,
>>JJ
>>>
>>>
>>>


>
>
>

passing a label value from webform(.aspx) page to a vb6 form

Hi,
I have a vb6 form which has a label on it. When they click on that label it
will display the new web form and ask them to fill details. Once they fill
details it will give confirmation number. Can i pass this confirmation numbe
r
back to windows form and display it using Message box?
please let me know
Thanks,
Sridhar.You can save the confirmation number to the database from the webform and
then have the VB6 Windows application query the database record for this
confirmation number then display it.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Sridhar" wrote:

> Hi,
> I have a vb6 form which has a label on it. When they click on that label
it
> will display the new web form and ask them to fill details. Once they fill
> details it will give confirmation number. Can i pass this confirmation num
ber
> back to windows form and display it using Message box?
> please let me know
> Thanks,
> Sridhar.
Hi,
I cannot do that because the database resides on the server. we install
this vb6 application on the client's computer and it does not have access to
the database.
Thanks,
Sridhar.
"Phillip Williams" wrote:
> You can save the confirmation number to the database from the webform and
> then have the VB6 Windows application query the database record for this
> confirmation number then display it.
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
> "Sridhar" wrote:
>
The VB6 app is launching a web page that is also on the server, correct? Tha
t
means the page gets processed server side and thus it can indeed access the
database if the proper connection string is supplied to it (suggested to
store the con string in the web.config file).
-Demetri
"Sridhar" wrote:
> Hi,
> I cannot do that because the database resides on the server. we install
> this vb6 application on the client's computer and it does not have access
to
> the database.
> Thanks,
> Sridhar.
> "Phillip Williams" wrote:
>
Never mind my last post, I was interpreting something else. Anyway, you can
have the vb6 app execute and parse the response of another web page who's
sole job is to get the new confirmation number and write it out for the vb6
app to parse.
Another solution would be the soap tool kit in the vb6 app and execute a web
service that returns the confirmation in xml.
Hope that gives you some ideas.
-Demetri
"Sridhar" wrote:
> Hi,
> I cannot do that because the database resides on the server. we install
> this vb6 application on the client's computer and it does not have access
to
> the database.
> Thanks,
> Sridhar.
> "Phillip Williams" wrote:
>

passing a string to a confirmation page

Hi folks -- newbie Dave here.

I have a page where a user enters some basic info (name, email address, etc.), then they click Submit.

I then display a confirmation page. I want to display text that says something like "Thanks Dave, we got your info".

In the info form page, I'm doing this when Submit is clicked:

Sub ConfirmMsg()
Dim name As String
name = txName.Text
Response.Redirect("free_cvi_confirm.aspx?name")
End Sub

Here is the Page_Load function on the confirmation page:

Private Sub Page_Load(ByVal .....)
Label1.Text = "Thanks " + Request.QueryString("name") + ", we got your info"
End Sub

This displays nothing when Label1 displays. And when I look in Request.QueryString, I also can't find the name value.

What am I doing wrong? I've tried a few different variations, but can't seem to hit it. Thanks in advance for your great help.

DaveHello, in the page where u submit the form the conform message page should be like this:


Protected Sub ConfirmMsg(ByVal sender As Object, ByVal e As EventArgs)
Dim name As String = String.Empty
name = txName.Text
Response.Redirect("free_cvi_confirm.aspx?name=" + name)
End Sub

In the second page:


Protected Sub Page_Load(ByVal src As Object, ByVal e As EventArgs)
Label1.Text = "Thanks " + Request.QueryString("name").ToString() + ", we got your info"
End Sub

Good Luck.
HI davehunt,

Welcome the asp.net forums...

Use this

Response.Redirect("free_cvi_confirm.aspx?name=" & name)

thatz it
I believe that the 2 methods suggested so far place the values of the variables in the querystring (and then retrieve the values from the querystring). If having the variables visible in the querystring is acceptable, then I don't see any reason not to use those methods.

However, if you want to "post" the variables instead use this...

In the first page:
<script runat="server">
Sub Submit(Sender as Object, e as EventArgs)
Server.Transfer("http://path/page2.aspx")
End Sub
</script>
<html>
<body>
<form runat="server">
<asp:TextBox ID="tbName" Runat="server" />
<br>
<asp:Button Text="Submit" Runat="server" OnClick="Submit" />
</form>
</body>
</html
In the second page:
<script runat="server">
Sub Page_Load(Sender as Object, e as EventArgs)
lblName.Text = Request.Form("tbName")
End Sub
</script>
<html>
<body>
<form runat="server">
Name =
<asp:Label id="lblName" Runat="server" />
</form>
</body>
</html
Hope this helps,
Rob
Thanks guys, this was a big help.

Dave

Passing a string to a client side function

I can suggest 2 similar options :

1. Put the xml string in a textbox control (and set the display style to
none using css stylesheet) then simply reference the value of your textbox
control, to get the XML string.

2. (Probably the better one) Add a hidden input field to your form, set the
runat attribute to server and then simply assign your XML string as the
value of the hidden input field from within your code behind. Using this
method the encoding is taken care of for you as the whole lot will be html
encoded. (I pretty sure this should then work fine, but I may be wrong!!)

Hope one of the above works for you.

Matt
http://www.3internet.com

"Jorell" <anonymous@dotnet.itags.org.discussions.microsoft.com> wrote in message
news:70A4100B-D764-4FEA-B111-A5B9AE9E6529@dotnet.itags.org.microsoft.com...
> Hi everyone,
> I have an XML that I create on the fly. I need to pass this to a
Javascript function and I do it in this way:
> Page.RegisterStartupScript("Test", "<script
language=""javascript"">printHidden('" & XML & "')</script>")
> This works however if you encase the XML in single quotes then there could
possibly a terminating ' in the XML and on the other hand if you encase the
XML in double quotes and there is a single " in the XML...this becomes the
terminator and the client side throws an error: Unterminated string constant
> The user enters the information the XML is built with and we must allow
them the ability to enter these any characters.
> What I need to do is encode the string server side before it is passed and
then unencode it on the client.
> I have attempted to use Regex.Escape on the Server then unescape() on the
client with no luck.
> Any ideas/suggestions would be great! Thank you
> JorellJorell,

If you use the option of outputting your text to a form variable you should
not need to use escape characters at all. If you just leave the string
exactly as you want it to appear and output it to the form variables, when
you retrieve the value you should see exactly what you are looking for. Or
is there something that I am missing as to why do you need to put escape
characters in?

Matt
http://www.3internet.com

"Jorell" <anonymous@.discussions.microsoft.com> wrote in message
news:B8A31C70-DF4A-49D1-AB87-CA7E3AF4487D@.microsoft.com...
> Hi there. Thank you for the suggestion. I tried this as I figured the same
however the value, innerText and innerHtml etc properties all return the
HTML but with the escape characters ie. \"
> This still causes and issue and without actually doing a loop to look for
escape characters and replacing them...but there is a possibly of not
catching all of them.
> Essentially I am just writing this HTML to a div using the document.write
method and then printing the div using execWB.
> Any ideas would be great thank you!
> Jorell
Hi there Matt
I actually don't want the characters in the string. What I have is Complex HTML that I have created in a server function

I have a js function which needs to take that HTML and write it to the Body of an IFrame that it creates. ( that can't be changed) So basically what I need to be able to do is end up with a variable inside that js function which is straight HTML no escapes.

Mostly the problem is if you use textboxes of any sort...the innerHtml, innerText, Text, or value fields always return the value with escape charaters when accessing them from the client. I am not sure why

So no matter what I put the HTML in, it adds escape chars

Any ideas? I appologize if it is unclear! Thank yo

Jorell

Friday, March 16, 2012

Passing a variable to HTML

Hi,

I'm creating a control that displays the Previous and Next Pages. I get the
values I want but they don't display in the HTML Href tag. It just displays
blank. I declared the 2 variables PageBack and PageNext outside the sub but
that doesn't seem to work.
I tried using a session variable but I had to reload the page twice to get
the correct number.

<%@dotnet.itags.org. Control Language="VB" %>
<script runat="server">
Dim PageBack as String
Dim PageNext as String

Sub Page_Load(sender As Object, e As EventArgs)
Dim strPageName = System.IO.Path.GetFileName(Request.Path)
Dim PageName as String = strPageName
Dim PageNumber As String = Mid(PageName,5,3)
Dim BackPg as String = PageNumber - 1
Dim NextPg as String = PageNumber + 1
PageBack= Left(PageName,4)&"00"&BackPg &".aspx"
PageNext= Left(PageName,4)&"00"&NextPg &".aspx"
End Sub

</script>
<a href="http://links.10026.com/?link=<%# PageBack %>">Back</a><br>
<a href="http://links.10026.com/?link=<%# PageNext %>">Next</a
Thanks

--
Message posted via http://www.dotnetmonster.com<a href="http://links.10026.com/?link='<%# PageBack %>'">Back</a><br
Thanks. That still gives me an empty Href. I'm doing a response.write to
make sure there's a value in the variable and there is.

--
Message posted via http://www.dotnetmonster.com

Passing a variable to HTML

Hi,
I'm creating a control that displays the Previous and Next Pages. I get the
values I want but they don't display in the HTML Href tag. It just displays
blank. I declared the 2 variables PageBack and PageNext outside the sub but
that doesn't seem to work.
I tried using a session variable but I had to reload the page twice to get
the correct number.
<%@dotnet.itags.org. Control Language="VB" %>
<script runat="server">
Dim PageBack as String
Dim PageNext as String
Sub Page_Load(sender As Object, e As EventArgs)
Dim strPageName = System.IO.Path.GetFileName(Request.Path)
Dim PageName as String = strPageName
Dim PageNumber As String = Mid(PageName,5,3)
Dim BackPg as String = PageNumber - 1
Dim NextPg as String = PageNumber + 1
PageBack= Left(PageName,4)&"00"&BackPg &".aspx"
PageNext= Left(PageName,4)&"00"&NextPg &".aspx"
End Sub
</script>
<a href="http://links.10026.com/?link=<%# PageBack %>">Back</a><br>
<a href="http://links.10026.com/?link=<%# PageNext %>">Next</a>
Thanks
Message posted via http://www.webservertalk.com<a href="http://links.10026.com/?link='<%# PageBack %>'">Back</a><br>
Thanks. That still gives me an empty Href. I'm doing a response.write to
make sure there's a value in the variable and there is.
Message posted via http://www.webservertalk.com

Passing Action Parameter

Hi,

I have used parameters with certain situations so far. For example, i want to display a product whose categoryID equals 3 and productID equals 345 and then these values are sent to the display page like < display.aspx?categoryID=3&productID=345 >. After that, this product is found from the database and is displayed. However, i have seen some websites which uses a parameter system with multiple actions. I mean there are some actions and also these type parameters. Here are some examples;

page.aspx?action=sendPMTo&userID=123 //send private message to the user whose id = 123

page.aspx?action=readPMs&messageID=124 //read private message whose id = 124

page.aspx?action=displayProduct&categoryID=1&productID =2 //display the product whose category = 1 and id = 2

There is a blank page and we use it for several actions. I think we can do this with if-else blocks, can't we? If we can't how can we do? Also if we do like this how about performance considertions of the application.

Thanks...

You'd probably be better with a case statement rather than an if-else block. Another consideration is that your application won't be secure since people would manually be able to change the strings and then you can have one rogue user sends PMs to everyone in the database. You'd probably want to encrypt that querystring if that's how you wanted to use your application.

As for how to do it, just do something like the following:

SelectCase Request.QueryString("action")

Case"sendPMTo"

'...code

'...Other case statements

EndSelect