Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Server.HTMLEncode Method


Message #1 by "Abdullah Jahir Uddin" <shahinbd@h...> on Tue, 6 Aug 2002 05:23:30
Hi all,

We use Server.HTMLEncode method to retrieve the text in the next page. Can 
anybody help me how to use it in the option button or drop down list. 
Suppose I've selected a purticular button, or selected a perticular field 
from the list. I want to show that perticur field in the next page. So, 
how will be the syntaxt?

Suppose in the text field we write:

<input name="Username" type="text" value="<%Server.HTMLEncode(username)%>">

or

<textarea name="comments" cols=40 rows=5>
<%=Server.HTMLEncode(comments)%></textarea>

So, how I'll write to select a perticular field in the option button/list 
box. Can anybody help?

Thanks in advance

Abdullah

Message #2 by "Peter Foti (PeterF)" <PeterF@S...> on Tue, 6 Aug 2002 10:40:37 -0400
I believe what you are looking for would be something like this:

<option value="1"><%=Server.HTMLEncode(username)%></option>

Note that you can replace the value attribute with something from the
database too.

Hope this helps.
Pete


> -----Original Message-----
> From: Abdullah Jahir Uddin [mailto:shahinbd@h...]
> Sent: Tuesday, August 06, 2002 5:24 AM
> To: ASP Databases
> Subject: [asp_databases] Server.HTMLEncode Method
> 
> 
> Hi all,
> 
> We use Server.HTMLEncode method to retrieve the text in the 
> next page. Can 
> anybody help me how to use it in the option button or drop down list. 
> Suppose I've selected a purticular button, or selected a 
> perticular field 
> from the list. I want to show that perticur field in the next 
> page. So, 
> how will be the syntaxt?
> 
> Suppose in the text field we write:
> 
> <input name="Username" type="text" 
> value="<%Server.HTMLEncode(username)%>">
> 
> or
> 
> <textarea name="comments" cols=40 rows=5>
> <%=Server.HTMLEncode(comments)%></textarea>
> 
> So, how I'll write to select a perticular field in the option 
> button/list 
> box. Can anybody help?
> 
> Thanks in advance
> 
> Abdullah
> 
> 
Message #3 by "Abdullah Jahir Uddin" <shahinbd@h...> on Wed, 7 Aug 2002 04:31:19
Hello Pete,

Thanks for your help. It is working properly in the list box. I mean, it 
is selecting the perticular value which I selected in the previous page. 
Any idea about the radio button?  Do I have to use a Function in this case?

again many thanks

Abdullah


> I believe what you are looking for would be something like this:

<option value="1"><%=Server.HTMLEncode(username)%></option>

Note that you can replace the value attribute with something from the
database too.

Hope this helps.
Pete


> -----Original Message-----
> From: Abdullah Jahir Uddin [mailto:shahinbd@h...]
> Sent: Tuesday, August 06, 2002 5:24 AM
> To: ASP Databases
> Subject: [asp_databases] Server.HTMLEncode Method
> 
> 
> Hi all,
> 
> We use Server.HTMLEncode method to retrieve the text in the 
> next page. Can 
> anybody help me how to use it in the option button or drop down list. 
> Suppose I've selected a purticular button, or selected a 
> perticular field 
> from the list. I want to show that perticur field in the next 
> page. So, 
> how will be the syntaxt?
> 
> Suppose in the text field we write:
> 
> <input name="Username" type="text" 
> value="<%Server.HTMLEncode(username)%>">
> 
> or
> 
> <textarea name="comments" cols=40 rows=5>
> <%=Server.HTMLEncode(comments)%></textarea>
> 
> So, how I'll write to select a perticular field in the option 
> button/list 
> box. Can anybody help?
> 
> Thanks in advance
> 
> Abdullah
> 
> 
Message #4 by "Peter Foti (PeterF)" <PeterF@S...> on Wed, 7 Aug 2002 10:33:09 -0400
No, you do not need to use a function.  It works the same way.  Radio
buttons have this layout:

<input type="radio" name="foo" value="bar" checked="checked" />Text to
display

So to use the same data as the previous <option> example, your code might
look like this (this line will probably get wrapped in the email):

<input type="radio" name="foo" value="1" /><%=Server.HTMLEncode(username)%>

Again, you'd probably generate the value attribute as well.

Hope this helps.
Pete


-----Original Message-----
From: Abdullah Jahir Uddin [mailto:shahinbd@h...]
Sent: Wednesday, August 07, 2002 4:31 AM
To: ASP Databases
Subject: [asp_databases] RE: Server.HTMLEncode Method


Hello Pete,

Thanks for your help. It is working properly in the list box. I mean, it 
is selecting the perticular value which I selected in the previous page. 
Any idea about the radio button?  Do I have to use a Function in this case?

again many thanks

Abdullah


> I believe what you are looking for would be something like this:

<option value="1"><%=Server.HTMLEncode(username)%></option>

Note that you can replace the value attribute with something from the
database too.

Hope this helps.
Pete


> -----Original Message-----
> From: Abdullah Jahir Uddin [mailto:shahinbd@h...]
> Sent: Tuesday, August 06, 2002 5:24 AM
> To: ASP Databases
> Subject: [asp_databases] Server.HTMLEncode Method
> 
> 
> Hi all,
> 
> We use Server.HTMLEncode method to retrieve the text in the 
> next page. Can 
> anybody help me how to use it in the option button or drop down list. 
> Suppose I've selected a purticular button, or selected a 
> perticular field 
> from the list. I want to show that perticur field in the next 
> page. So, 
> how will be the syntaxt?
> 
> Suppose in the text field we write:
> 
> <input name="Username" type="text" 
> value="<%Server.HTMLEncode(username)%>">
> 
> or
> 
> <textarea name="comments" cols=40 rows=5>
> <%=Server.HTMLEncode(comments)%></textarea>
> 
> So, how I'll write to select a perticular field in the option 
> button/list 
> box. Can anybody help?
> 
> Thanks in advance
> 
> Abdullah
> 
> 
Message #5 by "Abdullah Jahir Uddin" <shahinbd@h...> on Fri, 9 Aug 2002 02:51:33
Hello Pete,

Thanks for your respond.I tried this way to retrieve the value in the 
option button. But what actually happens is, when I take another radio 
button, it retrieve the value from the DB, but another option button comes 
at the top. Such as :

<input type="radio" name="foo" value="1" Checked="Checked"><%
=Server.HTMLEncode(strPriority)%><BR>
	<input type="radio" name="priority" value="High">High<BR>
        <input type="radio" name="priority" value="Normal">Normal<BR>
        <input type="radio" name="priority" value="Low">Low

If I select the Normal button, the output comes,
 Priority:
                      0  Normal--checked
                      0 High
                      0 Normal
                      0 Low 

So, do you have any idea about this matter.
Again thanks for your kind respond.

regards

Abdullah

> No, you do not need to use a function.  It works the same way.  Radio
buttons have this layout:

<input type="radio" name="foo" value="bar" checked="checked" />Text to
display

So to use the same data as the previous <option> example, your code might
look like this (this line will probably get wrapped in the email):

<input type="radio" name="foo" value="1" /><%=Server.HTMLEncode(username)%>

Again, you'd probably generate the value attribute as well.

Hope this helps.
Pete


-----Original Message-----
From: Abdullah Jahir Uddin [mailto:shahinbd@h...]
Sent: Wednesday, August 07, 2002 4:31 AM
To: ASP Databases
Subject: [asp_databases] RE: Server.HTMLEncode Method


Hello Pete,

Thanks for your help. It is working properly in the list box. I mean, it 
is selecting the perticular value which I selected in the previous page. 
Any idea about the radio button?  Do I have to use a Function in this case?

again many thanks

Abdullah


> I believe what you are looking for would be something like this:

<option value="1"><%=Server.HTMLEncode(username)%></option>

Note that you can replace the value attribute with something from the
database too.

Hope this helps.
Pete


> -----Original Message-----
> From: Abdullah Jahir Uddin [mailto:shahinbd@h...]
> Sent: Tuesday, August 06, 2002 5:24 AM
> To: ASP Databases
> Subject: [asp_databases] Server.HTMLEncode Method
> 
> 
> Hi all,
> 
> We use Server.HTMLEncode method to retrieve the text in the 
> next page. Can 
> anybody help me how to use it in the option button or drop down list. 
> Suppose I've selected a purticular button, or selected a 
> perticular field 
> from the list. I want to show that perticur field in the next 
> page. So, 
> how will be the syntaxt?
> 
> Suppose in the text field we write:
> 
> <input name="Username" type="text" 
> value="<%Server.HTMLEncode(username)%>">
> 
> or
> 
> <textarea name="comments" cols=40 rows=5>
> <%=Server.HTMLEncode(comments)%></textarea>
> 
> So, how I'll write to select a perticular field in the option 
> button/list 
> box. Can anybody help?
> 
> Thanks in advance
> 
> Abdullah
> 
> 
Message #6 by "Peter Foti (PeterF)" <PeterF@S...> on Fri, 9 Aug 2002 10:37:53 -0400
Hello,

I'm not sure I can grasp what it is that you are trying to do here without
seeing a larger portion of code.  Can you post it?  I will be out all next
week, so today will be the only day I can look at it until the 19th
(although someone else on the list might be able to help too).

Are you trying to check the appropriate value based on the strPriority
value?

Pete


> -----Original Message-----
> From: Abdullah Jahir Uddin [mailto:shahinbd@h...]
> Sent: Friday, August 09, 2002 2:52 AM
> To: ASP Databases
> Subject: [asp_databases] RE: Server.HTMLEncode Method
> 
> 
> Hello Pete,
> 
> Thanks for your respond.I tried this way to retrieve the value in the 
> option button. But what actually happens is, when I take 
> another radio 
> button, it retrieve the value from the DB, but another option 
> button comes 
> at the top. Such as :
> 
> <input type="radio" name="foo" value="1" Checked="Checked"><%
> =Server.HTMLEncode(strPriority)%><BR>
> 	<input type="radio" name="priority" value="High">High<BR>
>         <input type="radio" name="priority" value="Normal">Normal<BR>
>         <input type="radio" name="priority" value="Low">Low
> 
> If I select the Normal button, the output comes,
>  Priority:
>                       0  Normal--checked
>                       0 High
>                       0 Normal
>                       0 Low 
> 
> So, do you have any idea about this matter.
> Again thanks for your kind respond.
> 
> regards
> 
> Abdullah
> 
> > No, you do not need to use a function.  It works the same 
> way.  Radio
> buttons have this layout:
> 
> <input type="radio" name="foo" value="bar" checked="checked" />Text to
> display
> 
> So to use the same data as the previous <option> example, 
> your code might
> look like this (this line will probably get wrapped in the email):
> 
> <input type="radio" name="foo" value="1" 
> /><%=Server.HTMLEncode(username)%>
> 
> Again, you'd probably generate the value attribute as well.
> 
> Hope this helps.
> Pete
> 
> 
> -----Original Message-----
> From: Abdullah Jahir Uddin [mailto:shahinbd@h...]
> Sent: Wednesday, August 07, 2002 4:31 AM
> To: ASP Databases
> Subject: [asp_databases] RE: Server.HTMLEncode Method
> 
> 
> Hello Pete,
> 
> Thanks for your help. It is working properly in the list box. 
> I mean, it 
> is selecting the perticular value which I selected in the 
> previous page. 
> Any idea about the radio button?  Do I have to use a Function 
> in this case?
> 
> again many thanks
> 
> Abdullah
> 
> 
> > I believe what you are looking for would be something like this:
> 
> <option value="1"><%=Server.HTMLEncode(username)%></option>
> 
> Note that you can replace the value attribute with something from the
> database too.
> 
> Hope this helps.
> Pete
> 
> 
> > -----Original Message-----
> > From: Abdullah Jahir Uddin [mailto:shahinbd@h...]
> > Sent: Tuesday, August 06, 2002 5:24 AM
> > To: ASP Databases
> > Subject: [asp_databases] Server.HTMLEncode Method
> > 
> > 
> > Hi all,
> > 
> > We use Server.HTMLEncode method to retrieve the text in the 
> > next page. Can 
> > anybody help me how to use it in the option button or drop 
> down list. 
> > Suppose I've selected a purticular button, or selected a 
> > perticular field 
> > from the list. I want to show that perticur field in the next 
> > page. So, 
> > how will be the syntaxt?
> > 
> > Suppose in the text field we write:
> > 
> > <input name="Username" type="text" 
> > value="<%Server.HTMLEncode(username)%>">
> > 
> > or
> > 
> > <textarea name="comments" cols=40 rows=5>
> > <%=Server.HTMLEncode(comments)%></textarea>
> > 
> > So, how I'll write to select a perticular field in the option 
> > button/list 
> > box. Can anybody help?
> > 
> > Thanks in advance
> > 
> > Abdullah
> > 
> > 
> 

  Return to Index