Showing posts with label basic. Show all posts
Showing posts with label basic. Show all posts

Thursday, March 29, 2012

Pass multiple parameters into pages querystring property from jscript

This is a basic question but I cant seem to find the answer anywhere and
have never tried it before.

Here's one of many syntax I'm trying, but should at least show you what I'm
trying to do:

parent.data.frameElement.src="data.aspx?Task=CartAddNew & sku=" + ItemSku;

where there's 2 parameters, Task and sku, and I'm trying to pass a text
value of "CartAddNew" to the Task parameter and a value from the ItemSku
variable to the sku parameter.

Thanks.

--
moondaddy@dotnet.itags.org.nospam.comI found the answer in another posting when I searched on "Pass"

The correct way to separate the 2 parameters and their value assignments is
with a & and no spaces on each side. I had tried it with a space on each
side which made it fail. Here's what worked for me:

parent.data.frameElement.src="data.aspx?Task=CartAddNew&sku=" + sku;

refer to my post below for clarification on the value assignments.

--
moondaddy@.nospam.com
"moondaddy" <moondaddy@.nospam.com> wrote in message
news:%23C96wii$DHA.3960@.TK2MSFTNGP10.phx.gbl...
> This is a basic question but I cant seem to find the answer anywhere and
> have never tried it before.
> Here's one of many syntax I'm trying, but should at least show you what
I'm
> trying to do:
> parent.data.frameElement.src="data.aspx?Task=CartAddNew & sku=" + ItemSku;
> where there's 2 parameters, Task and sku, and I'm trying to pass a text
> value of "CartAddNew" to the Task parameter and a value from the ItemSku
> variable to the sku parameter.
> Thanks.
> --
> moondaddy@.nospam.com

pass several parameters

Hello,

I am new with asp.net and I have some basic questions:

1What's the normal way of passing several server objets )(asp:text...)values to another page, when I click in a submit button.
(the same that we were doing in asp with the post.

2.I have a page where I have to do a search of the data of a peron by Id.
When the user click in the search button after givint the id, dO I have to bind each server control (in this case 5 <asp: testbox..>, name, surname, address, age, date birth) to the result of the query to retrieve the data?
How do I do that if my result is in a only query?

ThanksSee if below Link coule helps you. Seems you also have to do same kind of business ligic.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconPassingServerControlValuesBetweenPages.asp

Monday, March 26, 2012

Pass Value from Code Behind to TextBox

Hi, I have a very basic question (I am a beginner)

How do I pass a value from the Code Behind to, say, a text box?

I've got this on my aspx page:

<asp:TextBoxID="TextBox1"runat="server"Text=strTestOnTextChanged="TextBox1_TextChanged"></asp:TextBox>

All I want to do is pass the value of strTest from the Code Behind to display in the Text Box. This is what I have in the code behind:

using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

publicpartialclass_Default : System.Web.UI.Page

{

protectedvoid Page_Load(object sender,EventArgs e)

{

String strText;strText ="Hello";

}

}

How can I get this to work?

It's very simple just try this

protectedvoid Page_Load(object sender,EventArgs e)

{

String strText;strText ="Hello";

TextBox1.Text =strText;

}


You are right...it is very simple;

Thanks for the help...and Iapologize for the very basic question;


don't forget to mark as answerd the post if it is.

Greets


Whenever you write something in PageLoad event, it should be executed with every postback event... So use IsPostBack event of page to identify page was post back or not ...

Wednesday, March 21, 2012

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

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
> > > > > > > > > > > > > > > > > >