By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,929 Members | 1,600 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,929 IT Pros & Developers. It's quick & easy.

So, should I think no one has a solution to this?

P: n/a
ani
I have been posting this question for the past 2 weeks and
there wasn't any response. I really don't understand why I
am not getting any responses. Does my question sound very
stupid? Anyway, here I am asking again. Someone please
please help me!!

How do I add a radiobuttonlist within a datalist
programatically.

My actual problem is with retrieving the user-input and
the form values at the same time.
I have a datalist control in my aspx page(this is
paginated and everytime submits to itself). I am
calling a function within my datalist that returns a html
control (radio button ) in the form of the string. I also
have asp server controls(labels) in the datalist. When
the form is processed, I am retrieving the values of the
radio buttons through Request.form. To retrieve the values
of the asp server controls , I am using FindControl
method. But this is written in the Page_Load method, so
it returns the values of the current page before the page
gets submitted. I want the values after the page gets
submitted. How do I retrieve them.
If I use onserverclick on my button (which is a html
control with rollover capability <a href>) , the
onclick doesn't work fine for validating the html
controls. I don't have runat=server on my form tag when I
have onclick attribute on the button. I am new to
asp.net. I am not able to use both onclick and
onserverclick at the same time. Why is it so..

Please help!!

<form id="frmQuestion" method="post" >

<ASP:DataList id="Questions" ShowHeader="false"
ShowFooter="false" runat="server" >
<ItemTemplate>
<TABLE ALIGN="left" >
<td>

<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_ID")%> '
ID="QuestionID" NAME="QuestionID">
</asp:Label>

</td>

<td>

<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_Txt")%>'
ID="QuestionTxt" NAME="QuestionTxt">
</asp:Label>

</td>

<td >

<%# DisplayAnswers(DataBinder.Eval
(Container.DataItem, "MainQuestion_ID"),DataBinder.Eval
(Container.DataItem, "QuestionTypeID")) %>

</td>
</tr></TABLE>
</ItemTemplate>
</ASP:DataList>

<table align=right >
<tr><td>

<a id=btnForward href="#"
onMouseOut="bforward.src='images/bforward.gif';"
onMouseOver="bforward.src='images/bforward_f2.gif';"
runat=server onclick="return validate();"><IMG
SRC="images/bforward.gif" ALT="" NAME="bforward"
ID="bforward" WIDTH="78" HEIGHT="24" BORDER="0"></A>

</td></tr></table>
I would like to retrieve the question id and the answer
(user-input) at the same time on click of the button.
The
questionaire is paginated and this is the only form i am
using.

The code behind looks somewhat this way:

Sub Page_Load(ByVal Sender As Object, ByVal E As
EventArgs)
Dim oDt As DataTable
Dim oQuestion As Question ('This is the
class
in my business layer)
oQuestion = New Question

Questions.DataSource = New DataView(oDt)
Questions.DataBind()

End Sub
how do I get questionid's and user-input to
insert into the database. There can be subquestions

Nov 17 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Ani,

You need to set up your controls to use runat=server. Then in your page load
use:
If Not IsPostBack so that the controls will only be set up the first time.

Now on postback of the form the controls values won't be overwritten when
you get them via FindControl.

I hope this helps.

(I haven't taken a look at the forum in the past two weeks, I've been
working on a large project, or I would have answered you.)
Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"ani" <an*******@discussions.microsoft.com> wrote in message
news:0f****************************@phx.gbl...
I have been posting this question for the past 2 weeks and
there wasn't any response. I really don't understand why I
am not getting any responses. Does my question sound very
stupid? Anyway, here I am asking again. Someone please
please help me!!

How do I add a radiobuttonlist within a datalist
programatically.

My actual problem is with retrieving the user-input and
the form values at the same time.
I have a datalist control in my aspx page(this is
paginated and everytime submits to itself). I am
calling a function within my datalist that returns a html
control (radio button ) in the form of the string. I also
have asp server controls(labels) in the datalist. When
the form is processed, I am retrieving the values of the
radio buttons through Request.form. To retrieve the values
of the asp server controls , I am using FindControl
method. But this is written in the Page_Load method, so
it returns the values of the current page before the page
gets submitted. I want the values after the page gets
submitted. How do I retrieve them.
If I use onserverclick on my button (which is a html
control with rollover capability <a href>) , the
onclick doesn't work fine for validating the html
controls. I don't have runat=server on my form tag when I
have onclick attribute on the button. I am new to
asp.net. I am not able to use both onclick and
onserverclick at the same time. Why is it so..

Please help!!

<form id="frmQuestion" method="post" >

<ASP:DataList id="Questions" ShowHeader="false"
ShowFooter="false" runat="server" >
<ItemTemplate>
<TABLE ALIGN="left" >
<td>

<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_ID")%> '
ID="QuestionID" NAME="QuestionID">
</asp:Label>

</td>

<td>

<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_Txt")%>'
ID="QuestionTxt" NAME="QuestionTxt">
</asp:Label>

</td>

<td >

<%# DisplayAnswers(DataBinder.Eval
(Container.DataItem, "MainQuestion_ID"),DataBinder.Eval
(Container.DataItem, "QuestionTypeID")) %>

</td>
</tr></TABLE>
</ItemTemplate>
</ASP:DataList>

<table align=right >
<tr><td>

<a id=btnForward href="#"
onMouseOut="bforward.src='images/bforward.gif';"
onMouseOver="bforward.src='images/bforward_f2.gif';"
runat=server onclick="return validate();"><IMG
SRC="images/bforward.gif" ALT="" NAME="bforward"
ID="bforward" WIDTH="78" HEIGHT="24" BORDER="0"></A>

</td></tr></table>
I would like to retrieve the question id and the answer
(user-input) at the same time on click of the button.
The
questionaire is paginated and this is the only form i am
using.

The code behind looks somewhat this way:

Sub Page_Load(ByVal Sender As Object, ByVal E As
EventArgs)
Dim oDt As DataTable
Dim oQuestion As Question ('This is the
class
in my business layer)
oQuestion = New Question

Questions.DataSource = New DataView(oDt)
Questions.DataBind()

End Sub
how do I get questionid's and user-input to
insert into the database. There can be subquestions

Nov 17 '05 #2

P: n/a
To add a button to your list, add code like this to your itemdatabound
e.item.cells[0].Controls.Add(new radiobuttonlist())

actually you should create your radiobutton outside, give it an ID, set its
value and then add it.
When you want to check the selection in the post, just do a find control on
the id and examine the selection property.

Does that help?

PS. I didn't see this post, i would have replied sooner. It's easier if you
give your questions a good subject so they have a better chance of catching
someone's attention

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"ani" <an*******@discussions.microsoft.com> wrote in message
news:0f****************************@phx.gbl...
I have been posting this question for the past 2 weeks and
there wasn't any response. I really don't understand why I
am not getting any responses. Does my question sound very
stupid? Anyway, here I am asking again. Someone please
please help me!!

How do I add a radiobuttonlist within a datalist
programatically.

My actual problem is with retrieving the user-input and
the form values at the same time.
I have a datalist control in my aspx page(this is
paginated and everytime submits to itself). I am
calling a function within my datalist that returns a html
control (radio button ) in the form of the string. I also
have asp server controls(labels) in the datalist. When
the form is processed, I am retrieving the values of the
radio buttons through Request.form. To retrieve the values
of the asp server controls , I am using FindControl
method. But this is written in the Page_Load method, so
it returns the values of the current page before the page
gets submitted. I want the values after the page gets
submitted. How do I retrieve them.
If I use onserverclick on my button (which is a html
control with rollover capability <a href>) , the
onclick doesn't work fine for validating the html
controls. I don't have runat=server on my form tag when I
have onclick attribute on the button. I am new to
asp.net. I am not able to use both onclick and
onserverclick at the same time. Why is it so..

Please help!!

<form id="frmQuestion" method="post" >

<ASP:DataList id="Questions" ShowHeader="false"
ShowFooter="false" runat="server" >
<ItemTemplate>
<TABLE ALIGN="left" >
<td>

<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_ID")%> '
ID="QuestionID" NAME="QuestionID">
</asp:Label>

</td>

<td>

<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_Txt")%>'
ID="QuestionTxt" NAME="QuestionTxt">
</asp:Label>

</td>

<td >

<%# DisplayAnswers(DataBinder.Eval
(Container.DataItem, "MainQuestion_ID"),DataBinder.Eval
(Container.DataItem, "QuestionTypeID")) %>

</td>
</tr></TABLE>
</ItemTemplate>
</ASP:DataList>

<table align=right >
<tr><td>

<a id=btnForward href="#"
onMouseOut="bforward.src='images/bforward.gif';"
onMouseOver="bforward.src='images/bforward_f2.gif';"
runat=server onclick="return validate();"><IMG
SRC="images/bforward.gif" ALT="" NAME="bforward"
ID="bforward" WIDTH="78" HEIGHT="24" BORDER="0"></A>

</td></tr></table>
I would like to retrieve the question id and the answer
(user-input) at the same time on click of the button.
The
questionaire is paginated and this is the only form i am
using.

The code behind looks somewhat this way:

Sub Page_Load(ByVal Sender As Object, ByVal E As
EventArgs)
Dim oDt As DataTable
Dim oQuestion As Question ('This is the
class
in my business layer)
oQuestion = New Question

Questions.DataSource = New DataView(oDt)
Questions.DataBind()

End Sub
how do I get questionid's and user-input to
insert into the database. There can be subquestions

Nov 17 '05 #3

P: n/a
Ani,

It sounds as if you don't fully understand the differences between classic
asp and .net.

You are correct. If you are simply having a function output raw html to the
page then you can not use the runat=server tag.

The runat=server tag goes inside a control's tags in the .aspx file and
means that the control it is attached to will be evaluated by the server
before it is delivered to the client.

You should take a look at the sample code provided in the tutorials here:

http://samples.gotdotnet.com/quickstart/aspplus/

These tutorials will give you the knowledge you need to understand how .net
works.

Best of luck!

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"ani" <an*******@discussions.microsoft.com> wrote in message
news:0c****************************@phx.gbl...
Thanks for the reply. I'll try out as said. If I use runat
attribute, the javascript doesn't work. That's the
problem. How do I make both the javascript and
onserverclick event work . The javascript validates the
html controls. By the way, can I have both asp server
controls and html controls, the way that I coded below.
The html controls are returned in the form of the string
from a function. I guess even if I use runat=server on my
controls, it really makes no difference, because the html
control is a text string returned to the page. And , I
cannot have runat=server on the form tag, because my
javascript isn't functioning properly if I use it.
Could you please suggest something else..

Thanks again for the posts.

P.S People are very curious if I say 'IS THERE NO ONE TO
HELP ME' as opposed to the subject being 'cannot use
onserverclick and onclick the same time' :-)
-----Original Message-----
Ani,

You need to set up your controls to use runat=server.

Then in your page load
use:
If Not IsPostBack so that the controls will only be set

up the first time.

Now on postback of the form the controls values won't be

overwritten when
you get them via FindControl.

I hope this helps.

(I haven't taken a look at the forum in the past two

weeks, I've been
working on a large project, or I would have answered you.)
Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"ani" <an*******@discussions.microsoft.com> wrote in

message
news:0f****************************@phx.gbl...
I have been posting this question for the past 2 weeks and there wasn't any response. I really don't understand why I am not getting any responses. Does my question sound very stupid? Anyway, here I am asking again. Someone please
please help me!!

How do I add a radiobuttonlist within a datalist
programatically.

My actual problem is with retrieving the user-input and
the form values at the same time.
I have a datalist control in my aspx page(this is
paginated and everytime submits to itself). I am
calling a function within my datalist that returns a html control (radio button ) in the form of the string. I also have asp server controls(labels) in the datalist. When
the form is processed, I am retrieving the values of the
radio buttons through Request.form. To retrieve the values of the asp server controls , I am using FindControl
method. But this is written in the Page_Load method, so
it returns the values of the current page before the page gets submitted. I want the values after the page gets
submitted. How do I retrieve them.
If I use onserverclick on my button (which is a html
control with rollover capability <a href>) , the
onclick doesn't work fine for validating the html
controls. I don't have runat=server on my form tag when I have onclick attribute on the button. I am new to
asp.net. I am not able to use both onclick and
onserverclick at the same time. Why is it so..

Please help!!

<form id="frmQuestion" method="post" >

<ASP:DataList id="Questions" ShowHeader="false"
ShowFooter="false" runat="server" >
<ItemTemplate>
<TABLE ALIGN="left" >
<td>

<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_ID")%> '
ID="QuestionID" NAME="QuestionID">
</asp:Label>

</td>

<td>

<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_Txt")%>'
ID="QuestionTxt" NAME="QuestionTxt">
</asp:Label>

</td>

<td >

<%# DisplayAnswers(DataBinder.Eval
(Container.DataItem, "MainQuestion_ID"),DataBinder.Eval
(Container.DataItem, "QuestionTypeID")) %>

</td>
</tr></TABLE>
</ItemTemplate>
</ASP:DataList>

<table align=right >
<tr><td>

<a id=btnForward href="#"
onMouseOut="bforward.src='images/bforward.gif';"
onMouseOver="bforward.src='images/bforward_f2.gif';"
runat=server onclick="return validate();"><IMG
SRC="images/bforward.gif" ALT="" NAME="bforward"
ID="bforward" WIDTH="78" HEIGHT="24" BORDER="0"></A>

</td></tr></table>
I would like to retrieve the question id and the answer
(user-input) at the same time on click of the button.
The
questionaire is paginated and this is the only form i am
using.

The code behind looks somewhat this way:

Sub Page_Load(ByVal Sender As Object, ByVal E As
EventArgs)
Dim oDt As DataTable
Dim oQuestion As Question ('This is the
class
in my business layer)
oQuestion = New Question

Questions.DataSource = New DataView(oDt)
Questions.DataBind()

End Sub
how do I get questionid's and user-input to
insert into the database. There can be subquestions

.

Nov 17 '05 #4

P: n/a
ani
Now, how do I solve my problem. Should I change my code
now? Can't have have both onserverclick and onclick .I am
a newbie. I'll go thro' the tutorials.But, I need to get
this working soon.

-----Original Message-----
Ani,

It sounds as if you don't fully understand the differences between classicasp and .net.

You are correct. If you are simply having a function output raw html to thepage then you can not use the runat=server tag.

The runat=server tag goes inside a control's tags in the .aspx file andmeans that the control it is attached to will be evaluated by the serverbefore it is delivered to the client.

You should take a look at the sample code provided in the tutorials here:
http://samples.gotdotnet.com/quickstart/aspplus/

These tutorials will give you the knowledge you need to understand how .networks.

Best of luck!

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"ani" <an*******@discussions.microsoft.com> wrote in messagenews:0c****************************@phx.gbl...
Thanks for the reply. I'll try out as said. If I use runat attribute, the javascript doesn't work. That's the
problem. How do I make both the javascript and
onserverclick event work . The javascript validates the
html controls. By the way, can I have both asp server
controls and html controls, the way that I coded below.
The html controls are returned in the form of the string
from a function. I guess even if I use runat=server on my controls, it really makes no difference, because the html control is a text string returned to the page. And , I
cannot have runat=server on the form tag, because my
javascript isn't functioning properly if I use it.
Could you please suggest something else..

Thanks again for the posts.

P.S People are very curious if I say 'IS THERE NO ONE TO HELP ME' as opposed to the subject being 'cannot use
onserverclick and onclick the same time' :-)
>-----Original Message-----
>Ani,
>
>You need to set up your controls to use runat=server.

Then in your page load
>use:
>If Not IsPostBack so that the controls will only be set

up the first time.
>
>Now on postback of the form the controls values won't be
overwritten when
>you get them via FindControl.
>
>I hope this helps.
>
>(I haven't taken a look at the forum in the past two

weeks, I've been
>working on a large project, or I would have answered
you.) >
>
>Sincerely,
>
>--
>S. Justin Gengo, MCP
>Web Developer
>
>Free code library at:
>www.aboutfortunate.com
>
>"Out of chaos comes order."
> Nietzche
>
>
>"ani" <an*******@discussions.microsoft.com> wrote in

message
>news:0f****************************@phx.gbl...
>> I have been posting this question for the past 2 weeks and
>> there wasn't any response. I really don't understand

why I
>> am not getting any responses. Does my question sound

very
>> stupid? Anyway, here I am asking again. Someone

please >> please help me!!
>>
>> How do I add a radiobuttonlist within a datalist
>> programatically.
>>
>> My actual problem is with retrieving the user-input and >> the form values at the same time.
>> I have a datalist control in my aspx page(this is
>> paginated and everytime submits to itself). I am
>> calling a function within my datalist that returns a

html
>> control (radio button ) in the form of the string. I

also
>> have asp server controls(labels) in the datalist. When >> the form is processed, I am retrieving the values of the >> radio buttons through Request.form. To retrieve the

values
>> of the asp server controls , I am using FindControl
>> method. But this is written in the Page_Load method, so >> it returns the values of the current page before the

page
>> gets submitted. I want the values after the page gets >> submitted. How do I retrieve them.
>> If I use onserverclick on my button (which is a html >> control with rollover capability <a href>) , the
>> onclick doesn't work fine for validating the html
>> controls. I don't have runat=server on my form tag

when I
>> have onclick attribute on the button. I am new to
>> asp.net. I am not able to use both onclick and
>> onserverclick at the same time. Why is it so..
>>
>> Please help!!
>>
>>
>>
>> <form id="frmQuestion" method="post" >
>>
>> <ASP:DataList id="Questions" ShowHeader="false"
>> ShowFooter="false" runat="server" >
>> <ItemTemplate>
>> <TABLE ALIGN="left" >
>> <td>
>>
>> <asp:Label runat="server" Text='<%# DataBinder.Eval >> (Container.DataItem, "MainQuestion_ID")%> '
>> ID="QuestionID" NAME="QuestionID">
>> </asp:Label>
>>
>> </td>
>>
>> <td>
>>
>> <asp:Label runat="server" Text='<%# DataBinder.Eval >> (Container.DataItem, "MainQuestion_Txt")%>'
>> ID="QuestionTxt" NAME="QuestionTxt">
>> </asp:Label>
>>
>> </td>
>>
>> <td >
>>
>> <%# DisplayAnswers(DataBinder.Eval
>> (Container.DataItem, "MainQuestion_ID"),DataBinder.Eval >> (Container.DataItem, "QuestionTypeID")) %>
>>
>> </td>
>> </tr></TABLE>
>> </ItemTemplate>
>> </ASP:DataList>
>>
>> <table align=right >
>> <tr><td>
>>
>> <a id=btnForward href="#"
>> onMouseOut="bforward.src='images/bforward.gif';"
>> onMouseOver="bforward.src='images/bforward_f2.gif';"
>> runat=server onclick="return validate();"><IMG
>> SRC="images/bforward.gif" ALT="" NAME="bforward"
>> ID="bforward" WIDTH="78" HEIGHT="24" BORDER="0"></A>
>>
>> </td></tr></table>
>>
>>
>> I would like to retrieve the question id and the answer >> (user-input) at the same time on click of the button.
>> The
>> questionaire is paginated and this is the only form i am >> using.
>>
>> The code behind looks somewhat this way:
>>
>> Sub Page_Load(ByVal Sender As Object, ByVal E As
>> EventArgs)
>>
>>
>> Dim oDt As DataTable
>> Dim oQuestion As Question ('This is the
>> class
>> in my business layer)
>> oQuestion = New Question
>>
>> Questions.DataSource = New DataView(oDt)
>> Questions.DataBind()
>>
>>
>>
>> End Sub
>>
>>
>> how do I get questionid's and user-input to
>> insert into the database. There can be subquestions
>>
>>
>>
>
>
>.
>

.

Nov 17 '05 #5

P: n/a
ani
Is it that forms that have runat=server can't be validated
using javascript?

-----Original Message-----
Ani,

It sounds as if you don't fully understand the differences between classicasp and .net.

You are correct. If you are simply having a function output raw html to thepage then you can not use the runat=server tag.

The runat=server tag goes inside a control's tags in the .aspx file andmeans that the control it is attached to will be evaluated by the serverbefore it is delivered to the client.

You should take a look at the sample code provided in the tutorials here:
http://samples.gotdotnet.com/quickstart/aspplus/

These tutorials will give you the knowledge you need to understand how .networks.

Best of luck!

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"ani" <an*******@discussions.microsoft.com> wrote in messagenews:0c****************************@phx.gbl...
Thanks for the reply. I'll try out as said. If I use runat attribute, the javascript doesn't work. That's the
problem. How do I make both the javascript and
onserverclick event work . The javascript validates the
html controls. By the way, can I have both asp server
controls and html controls, the way that I coded below.
The html controls are returned in the form of the string
from a function. I guess even if I use runat=server on my controls, it really makes no difference, because the html control is a text string returned to the page. And , I
cannot have runat=server on the form tag, because my
javascript isn't functioning properly if I use it.
Could you please suggest something else..

Thanks again for the posts.

P.S People are very curious if I say 'IS THERE NO ONE TO HELP ME' as opposed to the subject being 'cannot use
onserverclick and onclick the same time' :-)
>-----Original Message-----
>Ani,
>
>You need to set up your controls to use runat=server.

Then in your page load
>use:
>If Not IsPostBack so that the controls will only be set

up the first time.
>
>Now on postback of the form the controls values won't be
overwritten when
>you get them via FindControl.
>
>I hope this helps.
>
>(I haven't taken a look at the forum in the past two

weeks, I've been
>working on a large project, or I would have answered
you.) >
>
>Sincerely,
>
>--
>S. Justin Gengo, MCP
>Web Developer
>
>Free code library at:
>www.aboutfortunate.com
>
>"Out of chaos comes order."
> Nietzche
>
>
>"ani" <an*******@discussions.microsoft.com> wrote in

message
>news:0f****************************@phx.gbl...
>> I have been posting this question for the past 2 weeks and
>> there wasn't any response. I really don't understand

why I
>> am not getting any responses. Does my question sound

very
>> stupid? Anyway, here I am asking again. Someone

please >> please help me!!
>>
>> How do I add a radiobuttonlist within a datalist
>> programatically.
>>
>> My actual problem is with retrieving the user-input and >> the form values at the same time.
>> I have a datalist control in my aspx page(this is
>> paginated and everytime submits to itself). I am
>> calling a function within my datalist that returns a

html
>> control (radio button ) in the form of the string. I

also
>> have asp server controls(labels) in the datalist. When >> the form is processed, I am retrieving the values of the >> radio buttons through Request.form. To retrieve the

values
>> of the asp server controls , I am using FindControl
>> method. But this is written in the Page_Load method, so >> it returns the values of the current page before the

page
>> gets submitted. I want the values after the page gets >> submitted. How do I retrieve them.
>> If I use onserverclick on my button (which is a html >> control with rollover capability <a href>) , the
>> onclick doesn't work fine for validating the html
>> controls. I don't have runat=server on my form tag

when I
>> have onclick attribute on the button. I am new to
>> asp.net. I am not able to use both onclick and
>> onserverclick at the same time. Why is it so..
>>
>> Please help!!
>>
>>
>>
>> <form id="frmQuestion" method="post" >
>>
>> <ASP:DataList id="Questions" ShowHeader="false"
>> ShowFooter="false" runat="server" >
>> <ItemTemplate>
>> <TABLE ALIGN="left" >
>> <td>
>>
>> <asp:Label runat="server" Text='<%# DataBinder.Eval >> (Container.DataItem, "MainQuestion_ID")%> '
>> ID="QuestionID" NAME="QuestionID">
>> </asp:Label>
>>
>> </td>
>>
>> <td>
>>
>> <asp:Label runat="server" Text='<%# DataBinder.Eval >> (Container.DataItem, "MainQuestion_Txt")%>'
>> ID="QuestionTxt" NAME="QuestionTxt">
>> </asp:Label>
>>
>> </td>
>>
>> <td >
>>
>> <%# DisplayAnswers(DataBinder.Eval
>> (Container.DataItem, "MainQuestion_ID"),DataBinder.Eval >> (Container.DataItem, "QuestionTypeID")) %>
>>
>> </td>
>> </tr></TABLE>
>> </ItemTemplate>
>> </ASP:DataList>
>>
>> <table align=right >
>> <tr><td>
>>
>> <a id=btnForward href="#"
>> onMouseOut="bforward.src='images/bforward.gif';"
>> onMouseOver="bforward.src='images/bforward_f2.gif';"
>> runat=server onclick="return validate();"><IMG
>> SRC="images/bforward.gif" ALT="" NAME="bforward"
>> ID="bforward" WIDTH="78" HEIGHT="24" BORDER="0"></A>
>>
>> </td></tr></table>
>>
>>
>> I would like to retrieve the question id and the answer >> (user-input) at the same time on click of the button.
>> The
>> questionaire is paginated and this is the only form i am >> using.
>>
>> The code behind looks somewhat this way:
>>
>> Sub Page_Load(ByVal Sender As Object, ByVal E As
>> EventArgs)
>>
>>
>> Dim oDt As DataTable
>> Dim oQuestion As Question ('This is the
>> class
>> in my business layer)
>> oQuestion = New Question
>>
>> Questions.DataSource = New DataView(oDt)
>> Questions.DataBind()
>>
>>
>>
>> End Sub
>>
>>
>> how do I get questionid's and user-input to
>> insert into the database. There can be subquestions
>>
>>
>>
>
>
>.
>

.

Nov 17 '05 #6

P: n/a
Why not add validation controls to your project so validation is also done
on the server - instead of using your own validation.

"ani" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
Is it that forms that have runat=server can't be validated
using javascript?

-----Original Message-----
Ani,

It sounds as if you don't fully understand the

differences between classic
asp and .net.

You are correct. If you are simply having a function

output raw html to the
page then you can not use the runat=server tag.

The runat=server tag goes inside a control's tags in

the .aspx file and
means that the control it is attached to will be

evaluated by the server
before it is delivered to the client.

You should take a look at the sample code provided in the

tutorials here:

http://samples.gotdotnet.com/quickstart/aspplus/

These tutorials will give you the knowledge you need to

understand how .net
works.

Best of luck!

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"ani" <an*******@discussions.microsoft.com> wrote in

message
news:0c****************************@phx.gbl...
Thanks for the reply. I'll try out as said. If I use runat attribute, the javascript doesn't work. That's the
problem. How do I make both the javascript and
onserverclick event work . The javascript validates the
html controls. By the way, can I have both asp server
controls and html controls, the way that I coded below.
The html controls are returned in the form of the string
from a function. I guess even if I use runat=server on my controls, it really makes no difference, because the html control is a text string returned to the page. And , I
cannot have runat=server on the form tag, because my
javascript isn't functioning properly if I use it.
Could you please suggest something else..

Thanks again for the posts.

P.S People are very curious if I say 'IS THERE NO ONE TO HELP ME' as opposed to the subject being 'cannot use
onserverclick and onclick the same time' :-)

>-----Original Message-----
>Ani,
>
>You need to set up your controls to use runat=server.
Then in your page load
>use:
>If Not IsPostBack so that the controls will only be set
up the first time.
>
>Now on postback of the form the controls values won't be overwritten when
>you get them via FindControl.
>
>I hope this helps.
>
>(I haven't taken a look at the forum in the past two
weeks, I've been
>working on a large project, or I would have answered you.) >
>
>Sincerely,
>
>--
>S. Justin Gengo, MCP
>Web Developer
>
>Free code library at:
>www.aboutfortunate.com
>
>"Out of chaos comes order."
> Nietzche
>
>
>"ani" <an*******@discussions.microsoft.com> wrote in
message
>news:0f****************************@phx.gbl...
>> I have been posting this question for the past 2 weeks and
>> there wasn't any response. I really don't understand
why I
>> am not getting any responses. Does my question sound
very
>> stupid? Anyway, here I am asking again. Someone please >> please help me!!
>>
>> How do I add a radiobuttonlist within a datalist
>> programatically.
>>
>> My actual problem is with retrieving the user-input and >> the form values at the same time.
>> I have a datalist control in my aspx page(this is
>> paginated and everytime submits to itself). I am
>> calling a function within my datalist that returns a
html
>> control (radio button ) in the form of the string. I
also
>> have asp server controls(labels) in the datalist. When >> the form is processed, I am retrieving the values of the >> radio buttons through Request.form. To retrieve the
values
>> of the asp server controls , I am using FindControl
>> method. But this is written in the Page_Load method, so >> it returns the values of the current page before the
page
>> gets submitted. I want the values after the page gets >> submitted. How do I retrieve them.
>> If I use onserverclick on my button (which is a html >> control with rollover capability <a href>) , the
>> onclick doesn't work fine for validating the html
>> controls. I don't have runat=server on my form tag
when I
>> have onclick attribute on the button. I am new to
>> asp.net. I am not able to use both onclick and
>> onserverclick at the same time. Why is it so..
>>
>> Please help!!
>>
>>
>>
>> <form id="frmQuestion" method="post" >
>>
>> <ASP:DataList id="Questions" ShowHeader="false"
>> ShowFooter="false" runat="server" >
>> <ItemTemplate>
>> <TABLE ALIGN="left" >
>> <td>
>>
>> <asp:Label runat="server" Text='<%# DataBinder.Eval >> (Container.DataItem, "MainQuestion_ID")%> '
>> ID="QuestionID" NAME="QuestionID">
>> </asp:Label>
>>
>> </td>
>>
>> <td>
>>
>> <asp:Label runat="server" Text='<%# DataBinder.Eval >> (Container.DataItem, "MainQuestion_Txt")%>'
>> ID="QuestionTxt" NAME="QuestionTxt">
>> </asp:Label>
>>
>> </td>
>>
>> <td >
>>
>> <%# DisplayAnswers(DataBinder.Eval
>> (Container.DataItem, "MainQuestion_ID"),DataBinder.Eval >> (Container.DataItem, "QuestionTypeID")) %>
>>
>> </td>
>> </tr></TABLE>
>> </ItemTemplate>
>> </ASP:DataList>
>>
>> <table align=right >
>> <tr><td>
>>
>> <a id=btnForward href="#"
>> onMouseOut="bforward.src='images/bforward.gif';"
>> onMouseOver="bforward.src='images/bforward_f2.gif';"
>> runat=server onclick="return validate();"><IMG
>> SRC="images/bforward.gif" ALT="" NAME="bforward"
>> ID="bforward" WIDTH="78" HEIGHT="24" BORDER="0"></A>
>>
>> </td></tr></table>
>>
>>
>> I would like to retrieve the question id and the answer >> (user-input) at the same time on click of the button.
>> The
>> questionaire is paginated and this is the only form i am >> using.
>>
>> The code behind looks somewhat this way:
>>
>> Sub Page_Load(ByVal Sender As Object, ByVal E As
>> EventArgs)
>>
>>
>> Dim oDt As DataTable
>> Dim oQuestion As Question ('This is the
>> class
>> in my business layer)
>> oQuestion = New Question
>>
>> Questions.DataSource = New DataView(oDt)
>> Questions.DataBind()
>>
>>
>>
>> End Sub
>>
>>
>> how do I get questionid's and user-input to
>> insert into the database. There can be subquestions
>>
>>
>>
>
>
>.
>

.

Nov 17 '05 #7

P: n/a
Ani,

The way to solve your problem is to learn as quickly as you can how to use
the .Net language correctly. The reason people probably didn't respond to
your posts earlier is because it's easy to tell that you don't understand
how it works yet.

Yes that takes time which we developers are hard pressed to come by. But
trying to code any solution in any language without first learning that
language and learning the intricacies of how it works at the very best gives
you a solution that might work, but not efficiently. The difficulty here is
that your whole approach is questionable.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"ani" <an*******@discussions.microsoft.com> wrote in message
news:12****************************@phx.gbl...
Now, how do I solve my problem. Should I change my code
now? Can't have have both onserverclick and onclick .I am
a newbie. I'll go thro' the tutorials.But, I need to get
this working soon.

-----Original Message-----
Ani,

It sounds as if you don't fully understand the

differences between classic
asp and .net.

You are correct. If you are simply having a function

output raw html to the
page then you can not use the runat=server tag.

The runat=server tag goes inside a control's tags in

the .aspx file and
means that the control it is attached to will be

evaluated by the server
before it is delivered to the client.

You should take a look at the sample code provided in the

tutorials here:

http://samples.gotdotnet.com/quickstart/aspplus/

These tutorials will give you the knowledge you need to

understand how .net
works.

Best of luck!

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"ani" <an*******@discussions.microsoft.com> wrote in

message
news:0c****************************@phx.gbl...
Thanks for the reply. I'll try out as said. If I use runat attribute, the javascript doesn't work. That's the
problem. How do I make both the javascript and
onserverclick event work . The javascript validates the
html controls. By the way, can I have both asp server
controls and html controls, the way that I coded below.
The html controls are returned in the form of the string
from a function. I guess even if I use runat=server on my controls, it really makes no difference, because the html control is a text string returned to the page. And , I
cannot have runat=server on the form tag, because my
javascript isn't functioning properly if I use it.
Could you please suggest something else..

Thanks again for the posts.

P.S People are very curious if I say 'IS THERE NO ONE TO HELP ME' as opposed to the subject being 'cannot use
onserverclick and onclick the same time' :-)

>-----Original Message-----
>Ani,
>
>You need to set up your controls to use runat=server.
Then in your page load
>use:
>If Not IsPostBack so that the controls will only be set
up the first time.
>
>Now on postback of the form the controls values won't be overwritten when
>you get them via FindControl.
>
>I hope this helps.
>
>(I haven't taken a look at the forum in the past two
weeks, I've been
>working on a large project, or I would have answered you.) >
>
>Sincerely,
>
>--
>S. Justin Gengo, MCP
>Web Developer
>
>Free code library at:
>www.aboutfortunate.com
>
>"Out of chaos comes order."
> Nietzche
>
>
>"ani" <an*******@discussions.microsoft.com> wrote in
message
>news:0f****************************@phx.gbl...
>> I have been posting this question for the past 2 weeks and
>> there wasn't any response. I really don't understand
why I
>> am not getting any responses. Does my question sound
very
>> stupid? Anyway, here I am asking again. Someone please >> please help me!!
>>
>> How do I add a radiobuttonlist within a datalist
>> programatically.
>>
>> My actual problem is with retrieving the user-input and >> the form values at the same time.
>> I have a datalist control in my aspx page(this is
>> paginated and everytime submits to itself). I am
>> calling a function within my datalist that returns a
html
>> control (radio button ) in the form of the string. I
also
>> have asp server controls(labels) in the datalist. When >> the form is processed, I am retrieving the values of the >> radio buttons through Request.form. To retrieve the
values
>> of the asp server controls , I am using FindControl
>> method. But this is written in the Page_Load method, so >> it returns the values of the current page before the
page
>> gets submitted. I want the values after the page gets >> submitted. How do I retrieve them.
>> If I use onserverclick on my button (which is a html >> control with rollover capability <a href>) , the
>> onclick doesn't work fine for validating the html
>> controls. I don't have runat=server on my form tag
when I
>> have onclick attribute on the button. I am new to
>> asp.net. I am not able to use both onclick and
>> onserverclick at the same time. Why is it so..
>>
>> Please help!!
>>
>>
>>
>> <form id="frmQuestion" method="post" >
>>
>> <ASP:DataList id="Questions" ShowHeader="false"
>> ShowFooter="false" runat="server" >
>> <ItemTemplate>
>> <TABLE ALIGN="left" >
>> <td>
>>
>> <asp:Label runat="server" Text='<%# DataBinder.Eval >> (Container.DataItem, "MainQuestion_ID")%> '
>> ID="QuestionID" NAME="QuestionID">
>> </asp:Label>
>>
>> </td>
>>
>> <td>
>>
>> <asp:Label runat="server" Text='<%# DataBinder.Eval >> (Container.DataItem, "MainQuestion_Txt")%>'
>> ID="QuestionTxt" NAME="QuestionTxt">
>> </asp:Label>
>>
>> </td>
>>
>> <td >
>>
>> <%# DisplayAnswers(DataBinder.Eval
>> (Container.DataItem, "MainQuestion_ID"),DataBinder.Eval >> (Container.DataItem, "QuestionTypeID")) %>
>>
>> </td>
>> </tr></TABLE>
>> </ItemTemplate>
>> </ASP:DataList>
>>
>> <table align=right >
>> <tr><td>
>>
>> <a id=btnForward href="#"
>> onMouseOut="bforward.src='images/bforward.gif';"
>> onMouseOver="bforward.src='images/bforward_f2.gif';"
>> runat=server onclick="return validate();"><IMG
>> SRC="images/bforward.gif" ALT="" NAME="bforward"
>> ID="bforward" WIDTH="78" HEIGHT="24" BORDER="0"></A>
>>
>> </td></tr></table>
>>
>>
>> I would like to retrieve the question id and the answer >> (user-input) at the same time on click of the button.
>> The
>> questionaire is paginated and this is the only form i am >> using.
>>
>> The code behind looks somewhat this way:
>>
>> Sub Page_Load(ByVal Sender As Object, ByVal E As
>> EventArgs)
>>
>>
>> Dim oDt As DataTable
>> Dim oQuestion As Question ('This is the
>> class
>> in my business layer)
>> oQuestion = New Question
>>
>> Questions.DataSource = New DataView(oDt)
>> Questions.DataBind()
>>
>>
>>
>> End Sub
>>
>>
>> how do I get questionid's and user-input to
>> insert into the database. There can be subquestions
>>
>>
>>
>
>
>.
>

.

Nov 17 '05 #8

P: n/a
ani
Thanks for the reply. I'll try out as said. If I use runat
attribute, the javascript doesn't work. That's the
problem. How do I make both the javascript and
onserverclick event work . The javascript validates the
html controls. By the way, can I have both asp server
controls and html controls, the way that I coded below.
The html controls are returned in the form of the string
from a function. I guess even if I use runat=server on my
controls, it really makes no difference, because the html
control is a text string returned to the page. And , I
cannot have runat=server on the form tag, because my
javascript isn't functioning properly if I use it.
Could you please suggest something else..

Thanks again for the posts.

P.S People are very curious if I say 'IS THERE NO ONE TO
HELP ME' as opposed to the subject being 'cannot use
onserverclick and onclick the same time' :-)
-----Original Message-----
Ani,

You need to set up your controls to use runat=server. Then in your page loaduse:
If Not IsPostBack so that the controls will only be set up the first time.
Now on postback of the form the controls values won't be overwritten whenyou get them via FindControl.

I hope this helps.

(I haven't taken a look at the forum in the past two weeks, I've beenworking on a large project, or I would have answered you.)
Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"ani" <an*******@discussions.microsoft.com> wrote in messagenews:0f****************************@phx.gbl...
I have been posting this question for the past 2 weeks and there wasn't any response. I really don't understand why I am not getting any responses. Does my question sound very stupid? Anyway, here I am asking again. Someone please
please help me!!

How do I add a radiobuttonlist within a datalist
programatically.

My actual problem is with retrieving the user-input and
the form values at the same time.
I have a datalist control in my aspx page(this is
paginated and everytime submits to itself). I am
calling a function within my datalist that returns a html control (radio button ) in the form of the string. I also have asp server controls(labels) in the datalist. When
the form is processed, I am retrieving the values of the
radio buttons through Request.form. To retrieve the values of the asp server controls , I am using FindControl
method. But this is written in the Page_Load method, so
it returns the values of the current page before the page gets submitted. I want the values after the page gets
submitted. How do I retrieve them.
If I use onserverclick on my button (which is a html
control with rollover capability <a href>) , the
onclick doesn't work fine for validating the html
controls. I don't have runat=server on my form tag when I have onclick attribute on the button. I am new to
asp.net. I am not able to use both onclick and
onserverclick at the same time. Why is it so..

Please help!!

<form id="frmQuestion" method="post" >

<ASP:DataList id="Questions" ShowHeader="false"
ShowFooter="false" runat="server" >
<ItemTemplate>
<TABLE ALIGN="left" >
<td>

<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_ID")%> '
ID="QuestionID" NAME="QuestionID">
</asp:Label>

</td>

<td>

<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_Txt")%>'
ID="QuestionTxt" NAME="QuestionTxt">
</asp:Label>

</td>

<td >

<%# DisplayAnswers(DataBinder.Eval
(Container.DataItem, "MainQuestion_ID"),DataBinder.Eval
(Container.DataItem, "QuestionTypeID")) %>

</td>
</tr></TABLE>
</ItemTemplate>
</ASP:DataList>

<table align=right >
<tr><td>

<a id=btnForward href="#"
onMouseOut="bforward.src='images/bforward.gif';"
onMouseOver="bforward.src='images/bforward_f2.gif';"
runat=server onclick="return validate();"><IMG
SRC="images/bforward.gif" ALT="" NAME="bforward"
ID="bforward" WIDTH="78" HEIGHT="24" BORDER="0"></A>

</td></tr></table>
I would like to retrieve the question id and the answer
(user-input) at the same time on click of the button.
The
questionaire is paginated and this is the only form i am
using.

The code behind looks somewhat this way:

Sub Page_Load(ByVal Sender As Object, ByVal E As
EventArgs)
Dim oDt As DataTable
Dim oQuestion As Question ('This is the
class
in my business layer)
oQuestion = New Question

Questions.DataSource = New DataView(oDt)
Questions.DataBind()

End Sub
how do I get questionid's and user-input to
insert into the database. There can be subquestions

.

Nov 17 '05 #9

P: n/a
ani
Thank you. I think I better learn and then come back to
you guys.

-----Original Message-----
Ani,

The way to solve your problem is to learn as quickly as you can how to usethe .Net language correctly. The reason people probably didn't respond toyour posts earlier is because it's easy to tell that you don't understandhow it works yet.

Yes that takes time which we developers are hard pressed to come by. Buttrying to code any solution in any language without first learning thatlanguage and learning the intricacies of how it works at the very best givesyou a solution that might work, but not efficiently. The difficulty here isthat your whole approach is questionable.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"ani" <an*******@discussions.microsoft.com> wrote in messagenews:12****************************@phx.gbl...
Now, how do I solve my problem. Should I change my code
now? Can't have have both onserverclick and onclick .I am a newbie. I'll go thro' the tutorials.But, I need to get
this working soon.

>-----Original Message-----
>Ani,
>
>It sounds as if you don't fully understand the

differences between classic
>asp and .net.
>
>You are correct. If you are simply having a function

output raw html to the
>page then you can not use the runat=server tag.
>
>The runat=server tag goes inside a control's tags in

the .aspx file and
>means that the control it is attached to will be

evaluated by the server
>before it is delivered to the client.
>
>You should take a look at the sample code provided in the
tutorials here:
>
>http://samples.gotdotnet.com/quickstart/aspplus/
>
>These tutorials will give you the knowledge you need to

understand how .net
>works.
>
>Best of luck!
>
>--
>S. Justin Gengo, MCP
>Web Developer
>
>Free code library at:
>www.aboutfortunate.com
>
>"Out of chaos comes order."
> Nietzche
>
>
>"ani" <an*******@discussions.microsoft.com> wrote in

message
>news:0c****************************@phx.gbl...
>> Thanks for the reply. I'll try out as said. If I use

runat
>> attribute, the javascript doesn't work. That's the
>> problem. How do I make both the javascript and
>> onserverclick event work . The javascript validates
the >> html controls. By the way, can I have both asp server
>> controls and html controls, the way that I coded below. >> The html controls are returned in the form of the string >> from a function. I guess even if I use runat=server on my
>> controls, it really makes no difference, because the

html
>> control is a text string returned to the page. And ,
I >> cannot have runat=server on the form tag, because my
>> javascript isn't functioning properly if I use it.
>> Could you please suggest something else..
>>
>> Thanks again for the posts.
>>
>> P.S People are very curious if I say 'IS THERE NO ONE TO
>> HELP ME' as opposed to the subject being 'cannot use
>> onserverclick and onclick the same time' :-)
>>
>>
>>
>> >-----Original Message-----
>> >Ani,
>> >
>> >You need to set up your controls to use
runat=server. >> Then in your page load
>> >use:
>> >If Not IsPostBack so that the controls will only be set >> up the first time.
>> >
>> >Now on postback of the form the controls values won't be
>> overwritten when
>> >you get them via FindControl.
>> >
>> >I hope this helps.
>> >
>> >(I haven't taken a look at the forum in the past two
>> weeks, I've been
>> >working on a large project, or I would have answered

you.)
>> >
>> >
>> >Sincerely,
>> >
>> >--
>> >S. Justin Gengo, MCP
>> >Web Developer
>> >
>> >Free code library at:
>> >www.aboutfortunate.com
>> >
>> >"Out of chaos comes order."
>> > Nietzche
>> >
>> >
>> >"ani" <an*******@discussions.microsoft.com> wrote in
>> message
>> >news:0f****************************@phx.gbl...
>> >> I have been posting this question for the past 2

weeks
>> and
>> >> there wasn't any response. I really don't
understand >> why I
>> >> am not getting any responses. Does my question sound >> very
>> >> stupid? Anyway, here I am asking again. Someone

please
>> >> please help me!!
>> >>
>> >> How do I add a radiobuttonlist within a datalist
>> >> programatically.
>> >>
>> >> My actual problem is with retrieving the user- input and
>> >> the form values at the same time.
>> >> I have a datalist control in my aspx page(this is
>> >> paginated and everytime submits to itself). I am
>> >> calling a function within my datalist that
returns a >> html
>> >> control (radio button ) in the form of the string. I >> also
>> >> have asp server controls(labels) in the datalist.

When
>> >> the form is processed, I am retrieving the values of the
>> >> radio buttons through Request.form. To retrieve
the >> values
>> >> of the asp server controls , I am using FindControl >> >> method. But this is written in the Page_Load

method, so
>> >> it returns the values of the current page before the >> page
>> >> gets submitted. I want the values after the page

gets
>> >> submitted. How do I retrieve them.
>> >> If I use onserverclick on my button (which is a

html
>> >> control with rollover capability <a href>) , the
>> >> onclick doesn't work fine for validating the html
>> >> controls. I don't have runat=server on my form tag >> when I
>> >> have onclick attribute on the button. I am new to
>> >> asp.net. I am not able to use both onclick and
>> >> onserverclick at the same time. Why is it so..
>> >>
>> >> Please help!!
>> >>
>> >>
>> >>
>> >> <form id="frmQuestion" method="post" >
>> >>
>> >> <ASP:DataList id="Questions" ShowHeader="false"
>> >> ShowFooter="false" runat="server" >
>> >> <ItemTemplate>
>> >> <TABLE ALIGN="left" >
>> >> <td>
>> >>
>> >> <asp:Label runat="server" Text='<%#

DataBinder.Eval
>> >> (Container.DataItem, "MainQuestion_ID")%> '
>> >> ID="QuestionID" NAME="QuestionID">
>> >> </asp:Label>
>> >>
>> >> </td>
>> >>
>> >> <td>
>> >>
>> >> <asp:Label runat="server" Text='<%#

DataBinder.Eval
>> >> (Container.DataItem, "MainQuestion_Txt")%>'
>> >> ID="QuestionTxt" NAME="QuestionTxt">
>> >> </asp:Label>
>> >>
>> >> </td>
>> >>
>> >> <td >
>> >>
>> >> <%# DisplayAnswers(DataBinder.Eval
>> >>

(Container.DataItem, "MainQuestion_ID"),DataBinder.Eval
>> >> (Container.DataItem, "QuestionTypeID")) %>
>> >>
>> >> </td>
>> >> </tr></TABLE>
>> >> </ItemTemplate>
>> >> </ASP:DataList>
>> >>
>> >> <table align=right >
>> >> <tr><td>
>> >>
>> >> <a id=btnForward href="#"
>> >> onMouseOut="bforward.src='images/bforward.gif';"
>> >> onMouseOver="bforward.src='images/bforward_f2.gif';" >> >> runat=server onclick="return validate();"><IMG
>> >> SRC="images/bforward.gif" ALT="" NAME="bforward"
>> >> ID="bforward" WIDTH="78" HEIGHT="24" BORDER="0"></A> >> >>
>> >> </td></tr></table>
>> >>
>> >>
>> >> I would like to retrieve the question id and the

answer
>> >> (user-input) at the same time on click of the button. >> >> The
>> >> questionaire is paginated and this is the only form i am
>> >> using.
>> >>
>> >> The code behind looks somewhat this way:
>> >>
>> >> Sub Page_Load(ByVal Sender As Object, ByVal E As
>> >> EventArgs)
>> >>
>> >>
>> >> Dim oDt As DataTable
>> >> Dim oQuestion As Question ('This is

the >> >> class
>> >> in my business layer)
>> >> oQuestion = New Question
>> >>
>> >> Questions.DataSource = New DataView (oDt) >> >> Questions.DataBind()
>> >>
>> >>
>> >>
>> >> End Sub
>> >>
>> >>
>> >> how do I get questionid's and user-input to
>> >> insert into the database. There can be subquestions >> >>
>> >>
>> >>
>> >
>> >
>> >.
>> >
>
>
>.
>

.

Nov 17 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.