Showing posts with label fields. Show all posts
Showing posts with label fields. Show all posts

Thursday, March 29, 2012

pass parameter in hyperlink

Hi

I am displaying the results of a query in a datalist. There are 2 fields returned with one an icon set as a hyperlink as follows:

Smile [:)]
name

When someone clicks on the icon I would like the name parameter to be passed to a new page to be used in a new query. Can someone please point me in the right direction.

Matt

The simplest way of doing this is to append the name as a query string variable, e.g.

<a href="http://links.10026.com/?link=http://someurl.com?name=xyz">...</a>


Thanks for the quick response. My code looks as follows:

<ItemTemplate>

<asp:HyperLink ID="Hyperlink1" runat="server" NavigateUrl="~/Login.aspx"><asp:Image ID="Image1" runat="server" ImageUrl='<%# SetUrl(Eval("status")) %>' ImageAlign="Middle" /></asp:HyperLink><br />
<asp:Label ID="term_idLabel" runat="server" Text='<%# Eval("term_id") %>' Font-Names="Arial" Font-Size="Small" ForeColor="White"></asp:Label><br />
<br />
</ItemTemplate
Which displays my data as:

Smile [:)] Big Smile [:D]
name1 name2

If the user clicks on name1's icon I'd like to pass name1 as the parameter. How do I access this term_idLabel instance?
You'll want to change the NavigateUrl property in HyperLink1 so the term_id is evaluated and passed as a parameter. Try this:

NavigateUrl='<%# Eval("term_id", "~/Login.aspx?name={0}") %>'
The string will be formatted with the value for term_id replacing the {0}.

Wednesday, March 21, 2012

Passing a parameter to another page

On one page I have a datagrid which is filled when the user selects some search criteria (e.g. surname or DoB) in different text fields and clicking on a button control.

The datagrid also contains a 'button column' which the user can use to edit and save changes to individual records to the db.

I use the following code to access the PK of the table in question as a parameter for my update query:

Dim strPatID As String = e.Item.Cells(0).Text

strSQL = "UPDATE blah "
strSQL = strSQL & "SET blah blah blah"
strSQL = strSQL & "WHERE patid = '" & strPatID & "'"

All of this works fine.

However, I also want users to be able to add records to a related table (which is at the many end of a relationship) based on the record they've selected from the datagrid. I've set up a 'hyperlink column' in the same datagrid which redirects them to another page where they'll be able to add data and save it. Fine so far.

The problem is of course, I need the patid as the foreign key to this second table. How can I pass this as a parameter to the second page? Am I doing this the right way or is there a better way to add records to related tables?

I hope I've made myself clear. Please let me know if you need additional information.

Thanks in advance for any help.

MoYou could pass it in the querystring to the new page:

DetailEntry.aspx?PatID=xxxxxx

On the second page, you can use Request.Querystring("PatID") to get the value
Thanks very much for the response Jim. I'll try it out.
Best regards to JimRoss:

In addition to using QueryString, you can also think of :

Session Variables as another solution, in addition to the other solutions.

regards

Friday, March 16, 2012

Passing A Value To Server

Basic Web Form... A few text boxes and a checkbox - and a card reader...
The effect I want to accomplish is this:
The basic credit card fields are there and can be filled out. But if the
user swipes the card, I want to fill out the fields automatically and make
them read only. (So far I can do this.)
But I also want a checkbox to appear that indicates the card was swiped.
The user can clear the checkbox, re-enabling the fields so they can be
edited, but then I will no longer consider the data as being swiped. I want
the check box to disappear if they clear it.
Using server controls, if I create a checkbox, but make it not visible, then
it's not available at the client side to work with from client side code.
So I would need to send some flag back to the server to indicate a post back
and have the page re-rendered properly. But how do send info to the server
like that without having a visible control to attach the data to?
(Does this make any sense? Not sure if I'm explaining it well.)
Is there a way to send a value back to the server, in a postback, where the
data is not a property of a server control that's tracking viewstate? The
session object is only available on the server side right?
Any guidance here is appreciated. Thanks.
Jerryto send additional value to server , one commonly used method is
a HiddenControl (you will access it like Request.Forms["HiddenContrlName"]
from code behind)
or a TextBox Webcontrol with size 0 or attribute style='display:none' ..
But if the only purpose of post back is to display/check the checkbox ,
probabaly a better approach is to do the display/check in the client side
javascript ..
Instead of settign Visibility=False, you would just add an attribute to
make it hidden , but still available at client code
CheckBoxName.Attributes.Add("style='display:none'")
"Jerry Camel" wrote:

> Basic Web Form... A few text boxes and a checkbox - and a card reader...
> The effect I want to accomplish is this:
> The basic credit card fields are there and can be filled out. But if the
> user swipes the card, I want to fill out the fields automatically and make
> them read only. (So far I can do this.)
> But I also want a checkbox to appear that indicates the card was swiped.
> The user can clear the checkbox, re-enabling the fields so they can be
> edited, but then I will no longer consider the data as being swiped. I wa
nt
> the check box to disappear if they clear it.
> Using server controls, if I create a checkbox, but make it not visible, th
en
> it's not available at the client side to work with from client side code.
> So I would need to send some flag back to the server to indicate a post ba
ck
> and have the page re-rendered properly. But how do send info to the serve
r
> like that without having a visible control to attach the data to?
> (Does this make any sense? Not sure if I'm explaining it well.)
> Is there a way to send a value back to the server, in a postback, where th
e
> data is not a property of a server control that's tracking viewstate? The
> session object is only available on the server side right?
> Any guidance here is appreciated. Thanks.
> Jerry
>
>
Okay... I can have the checkbox on the form and available with 'Display:
None'...
But I can't seem to find the proper syntax to change the display state and
make it visible on the client side...
Thanks.
"Sreejith Ram" <SreejithRam@.discussions.microsoft.com> wrote in message
news:431FA795-5920-4B2C-81E1-98224CD89497@.microsoft.com...
> to send additional value to server , one commonly used method is
> a HiddenControl (you will access it like Request.Forms["HiddenContrlName"]
> from code behind)
> or a TextBox Webcontrol with size 0 or attribute style='display:none' ..
> But if the only purpose of post back is to display/check the checkbox ,
> probabaly a better approach is to do the display/check in the client side
> javascript ..
> Instead of settign Visibility=False, you would just add an attribute to
> make it hidden , but still available at client code
> CheckBoxName.Attributes.Add("style='display:none'")
>
> "Jerry Camel" wrote:
>
reader...
the
make
want
then
code.
back
server
the
The
Syntax to display ?
document.getElementById("CheckBoxClientName").style.display='' ;
document.getElementById("CheckBoxClientName").Checked = true;
this may help...
http://www.w3schools.com/htmldom/dom_obj_checkbox.asp
http://www.w3schools.com/htmldom/do...tyle.asp#layout
"Jerry Camel" wrote:

> Okay... I can have the checkbox on the form and available with 'Display:
> None'...
> But I can't seem to find the proper syntax to change the display state and
> make it visible on the client side...
> Thanks.
>
> "Sreejith Ram" <SreejithRam@.discussions.microsoft.com> wrote in message
> news:431FA795-5920-4B2C-81E1-98224CD89497@.microsoft.com...
> reader...
> the
> make
> want
> then
> code.
> back
> server
> the
> The
>
>
Thanks, but this doesn't seem to have any effect. I tried changing the
style.display property to all kinds of values, but the checkbox never
appears...
Jerry
"Sreejith Ram" <SreejithRam@.discussions.microsoft.com> wrote in message
news:514C006A-51EE-42B4-938C-506D452587A4@.microsoft.com...
> Syntax to display ?
> document.getElementById("CheckBoxClientName").style.display='' ;
> document.getElementById("CheckBoxClientName").Checked = true;
> this may help...
> http://www.w3schools.com/htmldom/dom_obj_checkbox.asp
> http://www.w3schools.com/htmldom/do...tyle.asp#layout
>
> "Jerry Camel" wrote:
>
'Display:
and
Request.Forms["HiddenContrlName"]
..
,
side
to
if
and
swiped.
be
I
visible,
post
where
viewstate?
Obviously there is some thing not right other than the syntax.. :) .. Is
there any javascript error when you call the function to display the
checkbox?...
if still no luck, you may want to create a simple HTML page with only
following code in it...
<INPUT TYPE=checkbox ID=chk1 style='display:hidden'>
<INPUT TYPE=button ID=btn1 onClick="toggle()" value="Click to Toggle
Display" >
<script>
function toggle(id)
{
el = document.getElementById("chk1");
var display = el.style.display ? '' : 'none';
el.style.display = display;
}
</script>
Once this works, you can compare with the HTML your aspx generated and that
may help in finding the issue..
This link got a working sample... with code...pls see if this helps..
http://www.sam-i-am.com/work/sandbo...le_display.html
"Jerry Camel" wrote:

> Thanks, but this doesn't seem to have any effect. I tried changing the
> style.display property to all kinds of values, but the checkbox never
> appears...
> Jerry
> "Sreejith Ram" <SreejithRam@.discussions.microsoft.com> wrote in message
> news:514C006A-51EE-42B4-938C-506D452587A4@.microsoft.com...
> 'Display:
> and
> Request.Forms["HiddenContrlName"]
> ...
> ,
> side
> to
> if
> and
> swiped.
> be
> I
> visible,
> post
> where
> viewstate?
>
>
I'll play with it. Thanks for your help. I was trying to use vbscript, but
I may have to switch to javascript...
Jerry
"Sreejith Ram" <SreejithRam@.discussions.microsoft.com> wrote in message
news:54BF5C69-C844-40FF-A427-409FEAED12EE@.microsoft.com...
> Obviously there is some thing not right other than the syntax.. :) .. Is
> there any javascript error when you call the function to display the
> checkbox?...
> if still no luck, you may want to create a simple HTML page with only
> following code in it...
> <INPUT TYPE=checkbox ID=chk1 style='display:hidden'>
> <INPUT TYPE=button ID=btn1 onClick="toggle()" value="Click to Toggle
> Display" >
> <script>
> function toggle(id)
> {
> el = document.getElementById("chk1");
> var display = el.style.display ? '' : 'none';
> el.style.display = display;
> }
> </script>
> Once this works, you can compare with the HTML your aspx generated and
that
> may help in finding the issue..
> This link got a working sample... with code...pls see if this helps..
> http://www.sam-i-am.com/work/sandbo...le_display.html
>
> "Jerry Camel" wrote:
>
document.getElementById("CheckBoxClientName").style.display='' ;
true;
state
message
style='display:none'
checkbox
client
attribute
But
automatically
can
swiped.
side
a
the
to?
postback,

Passing A Value To Server

Basic Web Form... A few text boxes and a checkbox - and a card reader...
The effect I want to accomplish is this:

The basic credit card fields are there and can be filled out. But if the
user swipes the card, I want to fill out the fields automatically and make
them read only. (So far I can do this.)

But I also want a checkbox to appear that indicates the card was swiped.
The user can clear the checkbox, re-enabling the fields so they can be
edited, but then I will no longer consider the data as being swiped. I want
the check box to disappear if they clear it.

Using server controls, if I create a checkbox, but make it not visible, then
it's not available at the client side to work with from client side code.
So I would need to send some flag back to the server to indicate a post back
and have the page re-rendered properly. But how do send info to the server
like that without having a visible control to attach the data to?

(Does this make any sense? Not sure if I'm explaining it well.)

Is there a way to send a value back to the server, in a postback, where the
data is not a property of a server control that's tracking viewstate? The
session object is only available on the server side right?

Any guidance here is appreciated. Thanks.

Jerryto send additional value to server , one commonly used method is

a HiddenControl (you will access it like Request.Forms["HiddenContrlName"]
from code behind)

or a TextBox Webcontrol with size 0 or attribute style='display:none' ..

But if the only purpose of post back is to display/check the checkbox ,
probabaly a better approach is to do the display/check in the client side
javascript ..

Instead of settign Visibility=False, you would just add an attribute to
make it hidden , but still available at client code

CheckBoxName.Attributes.Add("style='display:none'")

"Jerry Camel" wrote:

> Basic Web Form... A few text boxes and a checkbox - and a card reader...
> The effect I want to accomplish is this:
> The basic credit card fields are there and can be filled out. But if the
> user swipes the card, I want to fill out the fields automatically and make
> them read only. (So far I can do this.)
> But I also want a checkbox to appear that indicates the card was swiped.
> The user can clear the checkbox, re-enabling the fields so they can be
> edited, but then I will no longer consider the data as being swiped. I want
> the check box to disappear if they clear it.
> Using server controls, if I create a checkbox, but make it not visible, then
> it's not available at the client side to work with from client side code.
> So I would need to send some flag back to the server to indicate a post back
> and have the page re-rendered properly. But how do send info to the server
> like that without having a visible control to attach the data to?
> (Does this make any sense? Not sure if I'm explaining it well.)
> Is there a way to send a value back to the server, in a postback, where the
> data is not a property of a server control that's tracking viewstate? The
> session object is only available on the server side right?
> Any guidance here is appreciated. Thanks.
> Jerry
>
Okay... I can have the checkbox on the form and available with 'Display:
None'...

But I can't seem to find the proper syntax to change the display state and
make it visible on the client side...

Thanks.

"Sreejith Ram" <SreejithRam@.discussions.microsoft.com> wrote in message
news:431FA795-5920-4B2C-81E1-98224CD89497@.microsoft.com...
> to send additional value to server , one commonly used method is
> a HiddenControl (you will access it like Request.Forms["HiddenContrlName"]
> from code behind)
> or a TextBox Webcontrol with size 0 or attribute style='display:none' ..
> But if the only purpose of post back is to display/check the checkbox ,
> probabaly a better approach is to do the display/check in the client side
> javascript ..
> Instead of settign Visibility=False, you would just add an attribute to
> make it hidden , but still available at client code
> CheckBoxName.Attributes.Add("style='display:none'")
>
> "Jerry Camel" wrote:
> > Basic Web Form... A few text boxes and a checkbox - and a card
reader...
> > The effect I want to accomplish is this:
> > The basic credit card fields are there and can be filled out. But if
the
> > user swipes the card, I want to fill out the fields automatically and
make
> > them read only. (So far I can do this.)
> > But I also want a checkbox to appear that indicates the card was swiped.
> > The user can clear the checkbox, re-enabling the fields so they can be
> > edited, but then I will no longer consider the data as being swiped. I
want
> > the check box to disappear if they clear it.
> > Using server controls, if I create a checkbox, but make it not visible,
then
> > it's not available at the client side to work with from client side
code.
> > So I would need to send some flag back to the server to indicate a post
back
> > and have the page re-rendered properly. But how do send info to the
server
> > like that without having a visible control to attach the data to?
> > (Does this make any sense? Not sure if I'm explaining it well.)
> > Is there a way to send a value back to the server, in a postback, where
the
> > data is not a property of a server control that's tracking viewstate?
The
> > session object is only available on the server side right?
> > Any guidance here is appreciated. Thanks.
> > Jerry
Syntax to display ?

document.getElementById("CheckBoxClientName").style.display='' ;
document.getElementById("CheckBoxClientName").Checked = true;

this may help...
http://www.w3schools.com/htmldom/dom_obj_checkbox.asp
http://www.w3schools.com/htmldom/do...tyle.asp#layout

"Jerry Camel" wrote:

> Okay... I can have the checkbox on the form and available with 'Display:
> None'...
> But I can't seem to find the proper syntax to change the display state and
> make it visible on the client side...
> Thanks.
>
> "Sreejith Ram" <SreejithRam@.discussions.microsoft.com> wrote in message
> news:431FA795-5920-4B2C-81E1-98224CD89497@.microsoft.com...
> > to send additional value to server , one commonly used method is
> > a HiddenControl (you will access it like Request.Forms["HiddenContrlName"]
> > from code behind)
> > or a TextBox Webcontrol with size 0 or attribute style='display:none' ..
> > But if the only purpose of post back is to display/check the checkbox ,
> > probabaly a better approach is to do the display/check in the client side
> > javascript ..
> > Instead of settign Visibility=False, you would just add an attribute to
> > make it hidden , but still available at client code
> > CheckBoxName.Attributes.Add("style='display:none'")
> > "Jerry Camel" wrote:
> > > Basic Web Form... A few text boxes and a checkbox - and a card
> reader...
> > > The effect I want to accomplish is this:
> > > > The basic credit card fields are there and can be filled out. But if
> the
> > > user swipes the card, I want to fill out the fields automatically and
> make
> > > them read only. (So far I can do this.)
> > > > But I also want a checkbox to appear that indicates the card was swiped.
> > > The user can clear the checkbox, re-enabling the fields so they can be
> > > edited, but then I will no longer consider the data as being swiped. I
> want
> > > the check box to disappear if they clear it.
> > > > Using server controls, if I create a checkbox, but make it not visible,
> then
> > > it's not available at the client side to work with from client side
> code.
> > > So I would need to send some flag back to the server to indicate a post
> back
> > > and have the page re-rendered properly. But how do send info to the
> server
> > > like that without having a visible control to attach the data to?
> > > > (Does this make any sense? Not sure if I'm explaining it well.)
> > > > Is there a way to send a value back to the server, in a postback, where
> the
> > > data is not a property of a server control that's tracking viewstate?
> The
> > > session object is only available on the server side right?
> > > > Any guidance here is appreciated. Thanks.
> > > > Jerry
> > > >
Thanks, but this doesn't seem to have any effect. I tried changing the
style.display property to all kinds of values, but the checkbox never
appears...

Jerry

"Sreejith Ram" <SreejithRam@.discussions.microsoft.com> wrote in message
news:514C006A-51EE-42B4-938C-506D452587A4@.microsoft.com...
> Syntax to display ?
> document.getElementById("CheckBoxClientName").style.display='' ;
> document.getElementById("CheckBoxClientName").Checked = true;
> this may help...
> http://www.w3schools.com/htmldom/dom_obj_checkbox.asp
> http://www.w3schools.com/htmldom/do...tyle.asp#layout
>
> "Jerry Camel" wrote:
> > Okay... I can have the checkbox on the form and available with
'Display:
> > None'...
> > But I can't seem to find the proper syntax to change the display state
and
> > make it visible on the client side...
> > Thanks.
> > "Sreejith Ram" <SreejithRam@.discussions.microsoft.com> wrote in message
> > news:431FA795-5920-4B2C-81E1-98224CD89497@.microsoft.com...
> > > to send additional value to server , one commonly used method is
> > > > a HiddenControl (you will access it like
Request.Forms["HiddenContrlName"]
> > > from code behind)
> > > > or a TextBox Webcontrol with size 0 or attribute style='display:none'
...
> > > > But if the only purpose of post back is to display/check the checkbox
,
> > > probabaly a better approach is to do the display/check in the client
side
> > > javascript ..
> > > > Instead of settign Visibility=False, you would just add an attribute
to
> > > make it hidden , but still available at client code
> > > > CheckBoxName.Attributes.Add("style='display:none'")
> > > > > > "Jerry Camel" wrote:
> > > > > Basic Web Form... A few text boxes and a checkbox - and a card
> > reader...
> > > > The effect I want to accomplish is this:
> > > > > > The basic credit card fields are there and can be filled out. But
if
> > the
> > > > user swipes the card, I want to fill out the fields automatically
and
> > make
> > > > them read only. (So far I can do this.)
> > > > > > But I also want a checkbox to appear that indicates the card was
swiped.
> > > > The user can clear the checkbox, re-enabling the fields so they can
be
> > > > edited, but then I will no longer consider the data as being swiped.
I
> > want
> > > > the check box to disappear if they clear it.
> > > > > > Using server controls, if I create a checkbox, but make it not
visible,
> > then
> > > > it's not available at the client side to work with from client side
> > code.
> > > > So I would need to send some flag back to the server to indicate a
post
> > back
> > > > and have the page re-rendered properly. But how do send info to the
> > server
> > > > like that without having a visible control to attach the data to?
> > > > > > (Does this make any sense? Not sure if I'm explaining it well.)
> > > > > > Is there a way to send a value back to the server, in a postback,
where
> > the
> > > > data is not a property of a server control that's tracking
viewstate?
> > The
> > > > session object is only available on the server side right?
> > > > > > Any guidance here is appreciated. Thanks.
> > > > > > Jerry
> > > > > >
Obviously there is some thing not right other than the syntax.. :) .. Is
there any javascript error when you call the function to display the
checkbox?...

if still no luck, you may want to create a simple HTML page with only
following code in it...

<INPUT TYPE=checkbox ID=chk1 style='display:hidden'>
<INPUT TYPE=button ID=btn1 onClick="toggle()" value="Click to Toggle
Display"
<script>
function toggle(id)
{
el = document.getElementById("chk1");
var display = el.style.display ? '' : 'none';
el.style.display = display;
}
</script
Once this works, you can compare with the HTML your aspx generated and that
may help in finding the issue..

This link got a working sample... with code...pls see if this helps..
http://www.sam-i-am.com/work/sandbo...le_display.html

"Jerry Camel" wrote:

> Thanks, but this doesn't seem to have any effect. I tried changing the
> style.display property to all kinds of values, but the checkbox never
> appears...
> Jerry
> "Sreejith Ram" <SreejithRam@.discussions.microsoft.com> wrote in message
> news:514C006A-51EE-42B4-938C-506D452587A4@.microsoft.com...
> > Syntax to display ?
> > document.getElementById("CheckBoxClientName").style.display='' ;
> > document.getElementById("CheckBoxClientName").Checked = true;
> > this may help...
> > http://www.w3schools.com/htmldom/dom_obj_checkbox.asp
> > http://www.w3schools.com/htmldom/do...tyle.asp#layout
> > "Jerry Camel" wrote:
> > > Okay... I can have the checkbox on the form and available with
> 'Display:
> > > None'...
> > > > But I can't seem to find the proper syntax to change the display state
> and
> > > make it visible on the client side...
> > > > Thanks.
> > > > > "Sreejith Ram" <SreejithRam@.discussions.microsoft.com> wrote in message
> > > news:431FA795-5920-4B2C-81E1-98224CD89497@.microsoft.com...
> > > > to send additional value to server , one commonly used method is
> > > > > > a HiddenControl (you will access it like
> Request.Forms["HiddenContrlName"]
> > > > from code behind)
> > > > > > or a TextBox Webcontrol with size 0 or attribute style='display:none'
> ...
> > > > > > But if the only purpose of post back is to display/check the checkbox
> ,
> > > > probabaly a better approach is to do the display/check in the client
> side
> > > > javascript ..
> > > > > > Instead of settign Visibility=False, you would just add an attribute
> to
> > > > make it hidden , but still available at client code
> > > > > > CheckBoxName.Attributes.Add("style='display:none'")
> > > > > > > > > > "Jerry Camel" wrote:
> > > > > > > Basic Web Form... A few text boxes and a checkbox - and a card
> > > reader...
> > > > > The effect I want to accomplish is this:
> > > > > > > > The basic credit card fields are there and can be filled out. But
> if
> > > the
> > > > > user swipes the card, I want to fill out the fields automatically
> and
> > > make
> > > > > them read only. (So far I can do this.)
> > > > > > > > But I also want a checkbox to appear that indicates the card was
> swiped.
> > > > > The user can clear the checkbox, re-enabling the fields so they can
> be
> > > > > edited, but then I will no longer consider the data as being swiped.
> I
> > > want
> > > > > the check box to disappear if they clear it.
> > > > > > > > Using server controls, if I create a checkbox, but make it not
> visible,
> > > then
> > > > > it's not available at the client side to work with from client side
> > > code.
> > > > > So I would need to send some flag back to the server to indicate a
> post
> > > back
> > > > > and have the page re-rendered properly. But how do send info to the
> > > server
> > > > > like that without having a visible control to attach the data to?
> > > > > > > > (Does this make any sense? Not sure if I'm explaining it well.)
> > > > > > > > Is there a way to send a value back to the server, in a postback,
> where
> > > the
> > > > > data is not a property of a server control that's tracking
> viewstate?
> > > The
> > > > > session object is only available on the server side right?
> > > > > > > > Any guidance here is appreciated. Thanks.
> > > > > > > > Jerry
> > > > > > > > > > > > >
I'll play with it. Thanks for your help. I was trying to use vbscript, but
I may have to switch to javascript...

Jerry

"Sreejith Ram" <SreejithRam@.discussions.microsoft.com> wrote in message
news:54BF5C69-C844-40FF-A427-409FEAED12EE@.microsoft.com...
> Obviously there is some thing not right other than the syntax.. :) .. Is
> there any javascript error when you call the function to display the
> checkbox?...
> if still no luck, you may want to create a simple HTML page with only
> following code in it...
> <INPUT TYPE=checkbox ID=chk1 style='display:hidden'>
> <INPUT TYPE=button ID=btn1 onClick="toggle()" value="Click to Toggle
> Display" >
> <script>
> function toggle(id)
> {
> el = document.getElementById("chk1");
> var display = el.style.display ? '' : 'none';
> el.style.display = display;
> }
> </script>
> Once this works, you can compare with the HTML your aspx generated and
that
> may help in finding the issue..
> This link got a working sample... with code...pls see if this helps..
> http://www.sam-i-am.com/work/sandbo...le_display.html
>
> "Jerry Camel" wrote:
> > Thanks, but this doesn't seem to have any effect. I tried changing the
> > style.display property to all kinds of values, but the checkbox never
> > appears...
> > Jerry
> > "Sreejith Ram" <SreejithRam@.discussions.microsoft.com> wrote in message
> > news:514C006A-51EE-42B4-938C-506D452587A4@.microsoft.com...
> > > Syntax to display ?
> > document.getElementById("CheckBoxClientName").style.display='' ;
> > > document.getElementById("CheckBoxClientName").Checked =
true;
> > > > this may help...
> > > http://www.w3schools.com/htmldom/dom_obj_checkbox.asp
> > > http://www.w3schools.com/htmldom/do...tyle.asp#layout
> > > > > > "Jerry Camel" wrote:
> > > > > Okay... I can have the checkbox on the form and available with
> > 'Display:
> > > > None'...
> > > > > > But I can't seem to find the proper syntax to change the display
state
> > and
> > > > make it visible on the client side...
> > > > > > Thanks.
> > > > > > > > "Sreejith Ram" <SreejithRam@.discussions.microsoft.com> wrote in
message
> > > > news:431FA795-5920-4B2C-81E1-98224CD89497@.microsoft.com...
> > > > > to send additional value to server , one commonly used method is
> > > > > > > > a HiddenControl (you will access it like
> > Request.Forms["HiddenContrlName"]
> > > > > from code behind)
> > > > > > > > or a TextBox Webcontrol with size 0 or attribute
style='display:none'
> > ...
> > > > > > > > But if the only purpose of post back is to display/check the
checkbox
> > ,
> > > > > probabaly a better approach is to do the display/check in the
client
> > side
> > > > > javascript ..
> > > > > > > > Instead of settign Visibility=False, you would just add an
attribute
> > to
> > > > > make it hidden , but still available at client code
> > > > > > > > CheckBoxName.Attributes.Add("style='display:none'")
> > > > > > > > > > > > > > "Jerry Camel" wrote:
> > > > > > > > > Basic Web Form... A few text boxes and a checkbox - and a card
> > > > reader...
> > > > > > The effect I want to accomplish is this:
> > > > > > > > > > The basic credit card fields are there and can be filled out.
But
> > if
> > > > the
> > > > > > user swipes the card, I want to fill out the fields
automatically
> > and
> > > > make
> > > > > > them read only. (So far I can do this.)
> > > > > > > > > > But I also want a checkbox to appear that indicates the card was
> > swiped.
> > > > > > The user can clear the checkbox, re-enabling the fields so they
can
> > be
> > > > > > edited, but then I will no longer consider the data as being
swiped.
> > I
> > > > want
> > > > > > the check box to disappear if they clear it.
> > > > > > > > > > Using server controls, if I create a checkbox, but make it not
> > visible,
> > > > then
> > > > > > it's not available at the client side to work with from client
side
> > > > code.
> > > > > > So I would need to send some flag back to the server to indicate
a
> > post
> > > > back
> > > > > > and have the page re-rendered properly. But how do send info to
the
> > > > server
> > > > > > like that without having a visible control to attach the data
to?
> > > > > > > > > > (Does this make any sense? Not sure if I'm explaining it well.)
> > > > > > > > > > Is there a way to send a value back to the server, in a
postback,
> > where
> > > > the
> > > > > > data is not a property of a server control that's tracking
> > viewstate?
> > > > The
> > > > > > session object is only available on the server side right?
> > > > > > > > > > Any guidance here is appreciated. Thanks.
> > > > > > > > > > Jerry
> > > > > > > > > > > > > > > > > >