|
I have a datagrid that has one Template column and one button column.There is a RadioButtonList in Template column.I want when user click on button column,get which item is selected in radioButtonList of that row.I
overriden Item_Command of grid like this:
if(e.CommandName=="Vote")
{
RadioButtonList radio = (RadioButtonList)e.Item.FindControl("OptionsList");
Label2.Text = radio.SelectedIndex.ToString();
}
But it always show -1 and I can't get selected item!
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I have a user control that has a property which I want to bind it to a datasource.
QuestionID='<%# DataBinder.Eval(Container.DataItem, "QuestionID") %>'
But it seems that user control is not bindable.Is that True?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Does the QuestionID property have a BindableAttribute ?
"There are no stupid question's, just stupid people."
|
|
|
|
|
leppie wrote:
Does the QuestionID property have a BindableAttribute ?
Oh,I don't think so.How can I make it Bindable?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Mazdak wrote:
Oh,I don't think so.How can I make it Bindable?
[Bindable(true)]
public int QuestionID {get; set;}
"There are no stupid question's, just stupid people."
|
|
|
|
|
That doesn't help.Its User Control,not server control.Are you sure about it?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Mazdak wrote:
That doesn't help.Its User Control,not server control.Are you sure about it?
It shouldnt be any different to a Server / Web Control (although I didnt think about that originally ) . Paste us your code for the property and maybe I help you further
"There are no stupid question's, just stupid people."
|
|
|
|
|
public int QuestionID
{
get { return questionID; }
set { questionID = value; }
}
I don't think its possible for user control.The control first render,then the binding happend.I guess.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Mazdak wrote:
I don't think its possible for user control.
I started messing around with UserControls tonite, and I must agree with you (at least for now) .
You can however "manually" "bind" it at the page load event, erm I think, brain does not seem to function so well today
"There are no stupid question's, just stupid people."
|
|
|
|
|
You can!
Like this:
<uc1:UserDetails id="UserDetails1" runat="server"
Address='<%# DataBinder.Eval(ds1.Users[0], "Address") %>'
Username='<%# DataBinder.Eval(ds1.Users[0], "Username") %>'>
</uc1:UserDetails>
Address and Username is properties in the code-behind class.
[edit]eeek[/edit]
|
|
|
|
|
Could you please send me all your code?User Control and your aspx with its code-behind.
mazdakmansouri@hotmail.com
Thanks.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Mazdak wrote:
Could you please send me all your code?User Control and your aspx with its code-behind.
Erm no, sorry
But like I said it quite easy. Just do what I said.
- Define a property (Username) in the code-behind class (LoginControl) like this:
public string Username { get { return userTextBox.Text;} {set {userTextBox.Text = value;}}
- In the ascx file, "bind" it like this:
<uc1:LoginControl id="LoginControl1" Username='databind expression' runat=server></uc1:LoginControl>
Have a look on MSDN at databinding on web forms aka late-binding.
I find it easier to just map the data from the dataset to the control at a page event.
Hope this helps
"There are no stupid question's, just stupid people."
|
|
|
|
|
Can anyone help me. I want to setup a feedback form in my site. That should send the results to a email automatically. Any idea... I am a biginer, so... need simple exaples or stuffs like that....
|
|
|
|
|
SPS wrote:
I want to setup a feedback form in my site.
Create a new ASP page with an HTML form in it (look up HTML input elements and the FORM element.)
Then in the same page at the top catch the submit of the form and use CDONTS (lots of stuff on the web for CDONTS) to send the email to you.
Here is some source code
|
|
|
|
|
Will give a try from it...
Thanks.....
|
|
|
|
|
Hi,
In order to have the server understand the submission and send the mail to you, you need to have some sort of Serverside mailing component like CDONTS,Persits.MailSender Aspemail or a similar mailing component. Just a search of any of the above in your favorite search engine would surely get you to tons of sample source codes to play around with.
If you do not have one, perhaps you can check up with your ISP if he provides any mailer from his common script library.
If nothing works, there are a lot of freebie sites offering to send mails. One best example is: http://www.freedback.com/
deepak
|
|
|
|
|
good, but the site is asking for MONEY to use the form. I want the idea for feedback form, not bussiness... But THANKS for the help/reply...
|
|
|
|
|
Hi all
How would I do this? When I increase the width of an image it "grows" in height as well. How do I prevent this?
Cheers
[edit] nevermind, it is solved Nothing to see here, move along.[/edit]
"There are no stupid question's, just stupid people."
|
|
|
|
|
leppie wrote:
[edit] nevermind, it is solved Nothing to see here, move along.[/edit]
And you called me a DOPE! for not knowing about that IIS lockdown thing huh? Yeah yeah, be careful when you call someone a dope because two minutes later you may become one yourself!
p.s. Really interested to see the fruits of your labour what with all these questions
|
|
|
|
|
Paul Watson wrote:
And you called me a DOPE!
No I never, it was a DOPE to IIS lockdown, not you. Sorry for the misunderstanding, there is no Homer icon .
Cheers
Paul Watson wrote:
p.s. Really interested to see the fruits of your labour what with all these questions
PS: I have more! At least my combined crash course of ASP.NET, JavaScript, CSS and HTML paid off. Only 3 weeks and I feel pretty comfortable. Now I need to look at all those X thingies...;)
"There are no stupid question's, just stupid people."
|
|
|
|
|
leppie wrote:
there is no Homer icon
To the suggestions area, batman!
Paul
Why don't you take a good look at yourself and describe what you see - Led Zeppelin, Misty Mountain Hop
|
|
|
|
|
Paul Riley wrote:
To the suggestions area, batman!
I thought David Stone was the only member of the forum police
"There are no stupid question's, just stupid people."
|
|
|
|
|
leppie wrote:
I thought David Stone was the only member of the forum police
I didn't mean that in a forum police kind of way, just in a "how cool would a Homer smiley be?" way!
Paul
Why don't you take a good look at yourself and describe what you see - Led Zeppelin, Misty Mountain Hop
|
|
|
|
|
Paul Riley wrote:
I didn't mean that in a forum police kind of way, just in a "how cool would a Homer smiley be?" way!
It would You cant really laugh some things. I posted the suggestion, so we will see what happens.
CHeers
"There are no stupid question's, just stupid people."
|
|
|
|
|
Watch it mister. I catch this type of stuff again and I'm going to have to throw you in CP forum jail[^].
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|