Tracking Forums, Newsgroups, Maling Lists
Home Submit Tracker Forums
  Advanced Search
  HOME    TRACKER    ASP.NET


Advertisements:










MVC :: RadioButtons Loses Selection On Postback?


If I have a list of radiobuttons like this:

[Code]....

, when submitting the form and return the untyped View again, the selectionis lost. What is thebest practise to overcome thisin MVC?

My submit-action looks like this as I am also passing an uploaded file...

[Code]....


View 2 Replies (Posted: Oct 26, 2010 08:04 AM)

Sponsored Links:

Related Forum Messages For ASP.NET category:
Web Forms :: DropDownList Loses Selection On Autopostback?
I have a DetailsView that contains a DropDownList, bound to an objectdatasource, and I need to show/hide other fields in the view based on the DropDownLists's selection. So the ddl is set to autopostback and in the detailsView Load handler I show/hide the fields as needed, which works. But each postback clears any text field data input or selected.

On the first postback, the DropDown loses its selected value and goes back to default. On subsequent postbacks, it retains its choice, but is the only field to do so.

Posted: Jun 04, 2008 02:55 PM

View 7 Replies!   View Related
Web Forms :: Dynamic Controls Auto Postback (asp:radioButtons)?
I'm inserting controls dynamicaly on my page on pre-init, thease controls are inserting based on a dropDownList that load its values from a database. These values are diferent to all clients.

If I insert my controls on pre-init then I have access to the value of radiobuttons, but this insert only 1 controls cause in pre render I don't have the selected value of dropDown.

If I insert my controls on on-load event then I have the value of my dropDownList control so I can be able to inser the correct number o controls but I don't have the value of my auto-postback radioButtons.

I make a project to solve this and I share the code of it here. (VB.Net 4.0)

Front Code:

[Code]....

Posted: Jan 11, 2011 01:35 PM

View 7 Replies!   View Related
Web Forms :: RadioButtons Executing Server-side Code On Every Postback?
I have a user control with a dozen radion buttons in it.Every pair of radio buttons execute a Sub on server side.All of the radio buttons have the autopostback set to true.There is a public Sub of the usercontrol that gets called only once by the page and loads the data setting the radio buttons to checked or not checked.The problem is, that once a radio button is set, it will execute it's server side code on every postback even if the postback is caused by another control on the usercontrol or even another control on the page. So if all the radiobutton pairs are set and a postback is caused, there will be six server side Sub executing! Casting the sender in each of those Subs gives back the radiobutton that is checked at that point, so it's if on every postback the event is fired for each checked radiobutton.

Posted: Jun 01, 2010 02:17 PM

View 2 Replies!   View Related
C# - Radio Button Loses Value On Postback?
I have a set of radio buttons for "yes" and "no" values which have a name="choice". "yes" is checked by default. They're both runat="server". I read the choice on postback like below. It works perfectly fine as long as the validation doesn't fail. For example, if I select "no" and validation fails on postback, I still see "no" selected. But if I submit the form after correcting everything, the value read is "yes" on server side! Is this a bug in .net, and if so, how do i fix this?

foreach (string key in Request.Form.AllKeys)
{
if (key.EndsWith("choice"))
return Request.Form[key] == "yes";
}

Posted: May 3 10 at 16:32

View 1 Replies!   View Related
Postback - .Net RadioButton Loses ViewState
I'm having trouble with a simple radio set of two radio buttons (I don't want to use a RadioButtonList [RBL] because RBL doesn't allow child controls, and in my case, if you select one option, I want to enable a textbox next to the button; yes you could hack this with jQuery to move the textbox, but that's dirty!). I would check one, submit the form (either explicitly or through AutoPostBack), and the CheckedChanged event would never fire. When the page was reloaded, both buttons would be unchecked, regardless of their initial state on non-postback load or the state before form submission.

form id="form1" runat="server" enableviewstate="true">
<div>
<asp:RadioButton ID="foo" Text="foo" runat="server" AutoPostBack="true" OnCheckedChanged="rbChanged" Checked="true" GroupName="foobar" EnableViewState="true" />
<asp:RadioButton ID="bar" Text="bar" runat="server" AutoPostBack="true" GroupName="foobar"
OnCheckedChanged="rbChanged" Checked="false" EnableViewState="true" />
[code]...

Posted: Apr 13 10 at 19:42

View 2 Replies!   View Related
Web Forms :: FileUpload Control Loses Value On Postback?
I'm having a little problem with my file uploading. Does anybody know how to maintain the value in the FileUploadcontrol between server posts?

I have a form which, among other things, uploads a file. I am using an ileUploadcontrol (created dynamically) to let a user browse their PC for a file and then using the SaveAs method to upload the file to the server.When I'm selecting a file and Click on Next button for processing then selected file is lost.

Same is happening with me with HtmlTextArea (dynamically generated) , the problem was that I was not again re-initializing the controls after postback. What I did is re-initialized it in Init method of placeholder (as I have created/placed all dynamic controls in placeholder ).

But this thing is not working for fileupload control. I found solution in one of the forum is that "usehiddenField Control to transfer the selected file from the client to server"but this mechanism will only help to retain the name of file
in a hidden variable and the FileUpload1.PostedFile.SaveAs(filename) will not work bcz of absense of object (fileupload1).

here is code:

[Code]....

I have done almost the same in different test project , it works . I dont know whats wrong?

[Code]....

How to correct this?

Posted: Sep 11, 2010 05:49 PM

View 8 Replies!   View Related
State Management :: Textbox Loses Its Value After Postback?
There is button(btnOpen) and a textbox (txtResult) in the page.

Once I clicked on btnOpen, a modal dialog will appear, displaying TextBox1 and Button1.

The user is required to type something in TextBox1 and I want to pass the TextBox1.Text into my database but when I try to do that, the value actually = "", which is gone.

So I created this test program to illustrate by passing the value into a txtResult.

Can anyone guide me on getting the TextBox1.Text value?

Besides that, is there anyone to tell more about what does this lines of code do?

[Code]....

The aspx code:

[Code]....

the Code Behind .cs :

[Code]....

Posted: Oct 18, 2010 03:55 AM

View 2 Replies!   View Related
Web Forms :: Custom RadioButton Loses Checked Value On PostBack?
I am creating a control that inherits from the RadioButton, so that I can set the GroupName property manually.Everything is working okay apart from the fact that when the page posts back, the RadioButton becomes unchecked if it has previously been checked. This is the first time I've tried inheriting from controls, so must be doing something really silly.I would welcome anyone helping me to improve my code so that the control's Checked value persists through postbacks.I am causing a postback using a button, not the actual RadioButton itself, if that makes any difference. Here is my code:

[Code]....


Posted: Jan 28, 2010 06:14 PM

View 13 Replies!   View Related
Web Forms :: Visible False Loses Data On Postback?
I have the following simple code:

[Code]....

So when i select "Yes" from the first drop down, the "hiddenDetail" label becomes visible and when i select "No" from q1 the "hiddenDetail" label becomes invisible.The problem is that because i am using AutoPostBack when you select "No" the "hiddenDetail" loses its children (i.e. the label inside it) which is obvious why but i am wondering, is there anyway i can make the "hiddenDetail" invisible (sort of like display:none in style) in VB without losing its children. Or is my only option to work with this in

Posted: Feb 01, 2011 11:17 AM

View 9 Replies!   View Related
Repeater Databound Loses Data & Event On Postback - Is There A Best Practice Solution
Currently struggling with a problem that I've encountered variations on in the past. At the moment a worthwhile solution escapes me, but it seems such an obvious issue that I can't help wondering whether or not there's a "best practice" approach I should adopt.Without code, here's the issues in a nutshell:


page has databound control (a repeater) which isn't populated until user inputs data and clicks a button.Repeater item template contains a buttonUser clicks button, page posts back. On load, the repeater is actually empty so event is never handled because the originating control no longer existsGo back to the beginning of wretched cycle I've confirmed that this is the problem because if you provide the repeater with some static data on page load, everything works fine. But of course that's no use because it has to be populated dynamically.Is there a commonly approved way round this headache? I can store the data in session and re-use it on page load, but it seems terribly clumsy.

Posted: Oct 7 10 at 11:16

View 2 Replies!   View Related
AJAX :: Accordion Pane Header Loses CSS Style On Click (Postback Suppressed)
First time using an Accordion Control and I'm having some trouble with the CSS, as per the subject description.I have only created the headers so far and assigned some basic CSS to them. Right now that CSS is only there to limit the width (and therefore clickable area) of the header to the width of the image that the header is represented by. This works fine until I click on one of the headers and then its width property is lost.Same for the other headers, they are fine for the first click and then after that they lose their style.There is no postback caused by selecting a header so this is not the reason that the CSS is being lost.

Here is my html:

[Code]....

Posted: Apr 30, 2010 02:34 PM

View 1 Replies!   View Related
Custom Server Controls :: Composite Control With DropDownList Loses Items After Postback?
I'm creating a composite control which should be called from aspx/ascx like the following:

[Code]....

So, the Label should be rendered, together with an mandatory-sign and small tooltip popping up when mouseover is active. Additionally, the TextBox should be associated to the label and rendered.

For that I created a UserControl, derived from Label. I use the [ParseChildren(false)]-Property.

In CreateChildControls() I add the Link for the tooltip-layer and the tooltip itself. I also override the RenderChildren-function to add some html before/after rendering the textbox.

This works fine, even after Postback everything works as espected.

If I want to use a DropDownList instead of a TextBox, the DropDownList loses their items. After some websearch I think this is a viewstate-problem, but I don't know how to solve it.

Posted: Jul 28, 2009 11:51 AM

View 1 Replies!   View Related
Forms Data Controls :: LoginView Inside A Gridview Loses Hyperlink After Postback?
I have a gridview with columns 'Edit', 'Delete', 'View Results' and other details. The 'Edit' column opens a modal popup to edit the record. The 'View Result' column is in a login view and this column is only visible to users belonging to the group 'Manager' as below:

[Code]....

When the page is first loaded, the hyperlinks are displayed correctly. however, after editing a record and saving the changes, the 'View Results' column loses the hyperlink.

I tried creating a temp hyperlink column outside a loginview control and this seems to work correctly.

Posted: Feb 21, 2010 10:02 PM

View 4 Replies!   View Related
Custom Server Controls :: Custom Radio Button Loses State After Postback?
I have a custom radiobutton and it renders fine but loses state after postback.

How can it be modified?

[Code]....

Posted: Mar 24, 2010 01:35 PM

View 1 Replies!   View Related
Jquery Tab Selection On Postback?
I have an asp.net page with some JQuery tabs. Everything works ok.I added a dropdownlist in one of the tabs, that causes a postback. After the postback I want the same tab to be selected.I initialize the tabs as:

<script type="text/javascript">
$(document).ready(function() {
var $myTabs = $(".tabsDiv").tabs();
</script>

Then, on the PageLoad event, I inject a script to select the tab:

Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "TabSelect", "$myTabs.tabs('select', 1);", true);

For some reason this doesn't work. The script is running but the tabs are not selected.Is it because the RegisterClientScriptBlock places the script in the bottom of the page and, for some reason, it runs too late?

Posted: Jun 25 10 at 11:44

View 2 Replies!   View Related
Listbox Losing Selection After Postback?
I enabled postback and viewstate. So shouldn't my listbox remember what was selected after the postback?

<asp:ListBox ID="ListBox1" AutoPostBack="true" EnableViewState="true" runat="server"></asp:ListBox>

Posted: Sep 28th, 2009, 05:22 PM

View 2 Replies!   View Related
Checkboxlist Not Retaining Selection After Postback In IE?
Platform: ASP.Net 2.0 I have multiple checkboxlist controls on a webpage. Along with that i have the same number of buttons on that page. Initially all the checkboxlist controls are hidden. When user clicks on a button, corresponding checkboxlist controls gets visible making others hidden and allows user to select the options.

On postback, if user clicks on the same button again, the corresponding checkboxlist gets visible but the item selection is not retained. However, this happens only in IE. This works fine in FireFox. I am using JQuery to toggle the visibility of checkboxlist.I guess the problem is because i am toggling the visibility of checkboxlist which IE doesnt seem to like. What is the solution to this problem?

Posted: Aug 1 10 at 14:24

View 1 Replies!   View Related
Web Forms :: TreeView Node Selection Without Postback?
The TreeView EnableClientScript property lets node expansion be handled on the client. Is there a way to do the same for node selections?

Posted: Sep 01, 2009 05:46 AM

View 6 Replies!   View Related
C# - Changing Dropdownlist Selection Causes Full Postback?
I have a search page with a TextBox that allows someone to type in a search term and press enter. (Which fires TextChanged). I have a DropDownList that specifies the kind of search that will be performed. It is defined in the markup as follows:

<asp:DropDownList ID="lstSearchType" runat="server" AutoPostBack="false">
<asp:ListItem Value="0">Last, First</asp:ListItem>
<asp:ListItem Value="1">Last</asp:ListItem>
<asp:ListItem Value="2">First</asp:ListItem>
<asp:ListItem Value="3">Liberty ID</asp:ListItem>
<asp:ListItem Value="4">E-mail</asp:ListItem>
<asp:ListItem Value="5">Telephone</asp:ListItem>
<asp:ListItem Value="6">Birthday (exact m/d/yyyy)</asp:ListItem>
<asp:ListItem Value="7">SSN (exact ###-##-####)</asp:ListItem>
<asp:ListItem Value="8">Address</asp:ListItem>
</asp:DropDownList>

As you can see, AutoPostBack is set to false, and there is no event hookup.

Pressing enter fires the OnTextChanged event for the TextBox, which performs a search and updates a GridView in an UpdatePanel. This UpdatePanel has its UpdateMode set to conditional and has one trigger: the TextChanged event of the search TextBox.

It's very simple.

And it works beautifully, almost.

Whenever I change the search type, the very next search does a full postback. All subsequent searches do partial postbacks (as desired) unless I change the search type again.

There is one exception to this rule: if I load the page and immediately change the search type, it doesn't do a full postback. So the first change of the DropDownList before any postback (full or partial) does not trigger a full postback.

Full Disclosure: I'm doing a lot of JavaScript to change the appearance of the gridview during async requests. I don't detail it here because it seems unrelated. This problem only occurs when a DropDownList with no JavaScript wired up is changed.

Posted: May 6 10 at 13:20

View 1 Replies!   View Related
Web Forms :: Dropdownlist Selection Changes To First Item On Postback
I have been having some trouble with dropdown lists reverting back to selecting the initial item in the list after a postback once a selection has been made from the dropdown list. I have read up on this and found out that a "if not ispostback then" is required.This works fine when I add in all the items in the dropdown list manually like:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
ddl1.Items.Add("Select...") [code]....

However, I have over 250 items and so it is far more efficient for me to load then in by using part of a multidimensional array which is created from a text file - Definitive database.txt. I have been using the following code to do so:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
'loads the definitive database array[code]...

This loads all the items into the dropdown list perfectly, but now every time a selection is made, it reverts back to the inital item on postback even though i have included the "if not ispostback then" part.

Posted: Oct 19, 2010 09:05 PM

View 3 Replies!   View Related
Hide And Show Values Depending Upon The Selection Without Postback?
I have a dropdown box with 1 2 3 4

values if the value is 1 or 2 I have to dipslay another dll with values 5 and 6

I can do it using the autopostback=true But how can I do it with out setting the autopostback=true?

Posted: Dec 16, 2008 07:42 PM

View 6 Replies!   View Related
AJAX :: Put A Updateprogress Into A Webpage Where Selection From The Dropdownlist Causes Postback
I'm trying to put a updateprogressinto a webpage where selection from the dropdownlist causes postback.Works out wellexcept thaton the first postback, the gif image shows on the leftside rather than on the center. On succeeding postback, it will show on thecentre where I intend itto be. Below is my code:

[Code]....

Posted: Jun 23, 2010 10:21 AM

View 2 Replies!   View Related
Web Forms :: List Box Jumps Back To Top On Selection Of Item (Postback)
I have an asp:ListBox which contains a list of countries. Users select one or more countries and then assign them to another list box on the page.

<asp:ListBox id="countrylist" runat="server" SelectionMode="Multiple" AutoPostBack="True" CssClass="inputC" OnSelectedIndexChanged="countrylist_SelectedIndexChanged"></asp:ListBox>

In Internet Explorer, if I scroll down (say to United States) and then click it, the list scrolls back to the top. United States is still selected, if I press the "Assign" button it will appear within the second list box, and if I scroll down I can see that United States is still selected.

However, users are complaining about this, especially since it happens so quickly that they can't select multiple countries.

I tried using smartnavigation and MaintainScrollPosition, but this has had no effect.

<%@ Page Language="C#" smartNavigation="true" MaintainScrollPositionOnPostback="true" AutoEventWireup="true" EnableEventValidation="false" MasterPageFile="MasterPage.master" CodeFile="form.aspx.cs" Inherits="forms_template" %>

This behaviour is not exhibited in Firefox.

Posted: May 05, 2010 06:19 PM

View 2 Replies!   View Related
Forms Data Controls :: Drop Down Not Causing Postback On The First Selection
i have a dropdown list

<asp:DropDownList ID="DDName" runat="server" AutoPostBack="True"
DataSourceID="sdsName" DataTextField="Name" DataValueField="name_ID"
Width="179px">
</asp:DropDownList>

the problem that it is not causing post back on the first selection but on the second, I mean if i select from drop down list first selection no post back on the server,but when i select another item from the list (the second click on a different list item )

Posted: Oct 03, 2010 11:41 AM

View 4 Replies!   View Related
AJAX :: Using A Calendar Control's Date Selection As Asynchronous Postback Trigger?
I have a Calendar control inside an update panel and I have another update panel that I want to update when a date is selected on the calendar control.

I tried using this code with an asynchronous trigger but the whole page is still refreshing instead of just the panel.

<asp:UpdatePanel ID="updatePanelDailyEntries" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="calendarTimeRecording" EventName="SelectionChanged"/>
</Triggers>
<ContentTemplate> some content with a repeater </ContentTemplate>
</asp:UpdatePanel>

Posted: May 14, 2009 10:25 PM

View 4 Replies!   View Related
AJAX :: Textbox Postback Causing Radio Button List To Lose Selection?
This is likely a n00b question, but I can't seem to find any info on how to solve it. Here's the scenario:

I have a Textbox and a RadioButtonList in an UpdatePanel, both with AutoPostBack turned on (they need to be, can't turn it off on the text box))

The user enters some text in to the textbox, then clicks one of the Items in the radio button list.

Becausethe textbox post back is executing, the radio button is losing the value that the user selected.

How can I workaround this?

Posted: May 27, 2010 03:11 PM

View 4 Replies!   View Related
Web Forms :: How To Check RadioButtons
I have a gridview where each row has a radiobuttonlist(this controller is nested in a repeater) containing 3 radiobuttons with value 1,2 and 3.

How do I make a buttontoCheck all radiobuttons that has the value 1?

Posted: Jun 21, 2010 07:23 AM

View 9 Replies!   View Related
Web Forms :: How To Get All The Radiobuttons By Group Name
I need get radiobuttons by group name, I do findGetRadioButtonsByGroup function but do not know how to use it.

Posted: Sep 26, 2010 04:03 PM

View 3 Replies!   View Related
Best Way To Create A Table Of Radiobuttons?
Just started playing with .net, and am trying to design an online questionnaire, and have a question for which the answer should be a series of options with radiobuttons for each, in the format as shown below.

[code]....

Posted: Feb 20, 2009 03:18 PM

View 11 Replies!   View Related
RadioButtons, ListViews, And Grouping?
I've got a project I'm working on where I need to put a RadioButton inside a ListView, and have them all have the same GroupName. (can't use RadioButtonList, long story).[URL]This works perfectly, but with one small bug which undoubtedly will come back to bite me. If I click one radio button, and then click another while the javascript function is still running and has not completed; I can get 2 radiobuttons in the same group selected.

Posted: Feb 2 10 at 14:03

View 2 Replies!   View Related
MVC2 : Use Radiobuttons In A Grid?
Again a question about RadioButtons/ RadioButtonList

I've the following Model:

public class SkillLevelModel
{
public long? Id { get; set; }
public int? SelectedLevel { get; set;}
}
I've the following Controller:
public class SkillController : BaseController
{
public ActionResult Index()
{
var skills = new List<SkillLevelModel>();
for (int i = 0; i < 10; i++)
skills.Add(new SkillLevelModel() { Id = i, SelectedLevel = new Random().Next(0,5) });
return View(skills);
}

I've the following code in the View:

<% foreach (var item in Model) { %>
<tr>
<td style="width: 30px" align="center">
<%= Html.Encode(item.Id) %>
</td>
<td>
<% Html.RenderPartial("UCSkillLevel", item); %>
</td>
</tr>
<% } %>

I've the following code in the PartialView:

<% for (int i = 0; i <= 5; i++) { %>
<td align="center">
<%= Html.RadioButton("SelectedLevel", i, new { id = Model.Id + "_" + i })%>
</td>
<% } %>

The problem is that no radiobutton is checked, althought they have a level.

Posted: Apr 24 10 at 10:49

View 2 Replies!   View Related
MVC :: Bind Radiobuttons With Viewmodel?
I have a table called"question" which consists of various columns, including 3 columns of type: bit.

these columns are: yes, no, maybe.

The corresponding viewmodel has 3 properties of type boolean. The controller returns the views, which are based on the viewmodels.

By default MVC create checkboxes for boolean types, the thing is that the properties have to be related, only 1 should be checked at a time. That is why I want to change the checkboxes to radiobuttons.

After some search on the web I tried various things, in the end I got the create working by putting three radiobuttons, tied to the same boolean field, adjusing the values.

But how to edit a question? The view is filled with data from the database, putting 1 of the 3 booleans to true.

What should my view be like, to display 3 radiobuttons, mapped to the 3 boolean types?

techniques used:
MVC 3 RC 2 with razor
Entity Framework 4 (CTP 5)

Posted: Jan 27, 2011 09:39 AM

View 6 Replies!   View Related
Web Forms :: In A Selection Changed Event- How To Identify User Selection
I was wondering if anyone canhelp me work out what the user has selected in this selection changed event?his is what I have so far:

protected void rblNavigation_SelectedIndexChanged(object sender, EventArgs e)
{
string url = (GetCurrentPageName()).ToString() + "?" + Request.ServerVariables["QUERY_STRING"];

[code]...

The problem is that rblNavigation.SelectedValue is not the value that the user has selected to trigger this event. How do I get the value the user has just selected?I'm using C# and this selection event is inside my MasterPage.

Posted: Apr 07, 2010 03:57 PM

View 1 Replies!   View Related
Web Forms :: Hyperlink That Activated RadioButtons
have a web form that has 2 RadioButton.

[code]....

And I have other Web Forms that has 2 Hyperlinks that call the first Web Forms (RadioButton ones), activating one radiobutton or other.

How can i implement the hyperlinks activating the distints radiobuttons?

Posted: Sep 11, 2009 08:49 AM

View 2 Replies!   View Related
No Automation Like Selection Of The Controls And Selection Of Related Events?
Being a VB programmer, event handling had been straight forward. Open the code file and you can see all the controls in the left dropdown and all the related events on the right dropdown. ASP.Net with C# is something different. For example, I have raised Button_click event on "onclick"HTML event of a button. Now,I go to my aspx.cs file then do I have to write the whole function definition code by my self?

I mean to ask is that does everything have to be handwritten? No automation like selection of the controls and selection of related events.
I mean I want to understand the difference between the way event handling is done in a simple Vb desktop application and asp.net web application with web server controls invloved.

Posted: Oct 14, 2009 07:23 PM

View 14 Replies!   View Related
Validating And Capturing Dynamic Questionairre Radiobuttons
I am building a questionnaire which is populated from questions in my DB.

Each question has a radiobutton with value True or False.

But I never know how many questions there will be as these are dynamic from DB.

I want to retrieve all values from the radiobuttons and compare them with the answers also stored in the DB.

In the code behind how do I retrieve all the form values if i never know how many there will be ?

I had a variable to the radiobutton name like i.e question1,question2

Also thinking ahead how would i build validation on the radiobuttons that an answer must be selected.

Posted: Jan 21, 2009 09:42 AM

View 2 Replies!   View Related
Finding JavaScript To Allow Select Multiple Radiobuttons
I have a set of 2 radiobuttons and want the users to be able to select either one or both but right now it is only allowing me to select one of them. Is there some javascript that might allow me to be able to check both of them?

Posted: Feb 06, 2009 01:05 PM

View 2 Replies!   View Related
Creating Two Mutually Exclusive SETS Of Radiobuttons
I think this has to be THE most frustrating thing I've ever done in web forms. Yet one would think it would be the easiest of all things in the world to do. That is this:

I need 2 separate lists of radiobuttons on my .aspx page. One set allows a customer to select an option. The other set does also but for a different purpose. But only one set can have a selected radiobutton.

Ok I've tried this shit using 2 asp.net Radiobuttonlists controls on the same page. Got around the nasty bug with GroupName (asp.net assigns the control's uniqueID which prevents the groupname from ever working because now, 2 radiobuttonlists can't have the same groupname for all their radiobuttons because each radiobuttonlist has a different uniqueID thus the bug assigns the unique ID as the name attribute when the buttons are rendered. since the name sets are different, they are not mutually exclusive).

Anyway, so I created that custom RadioButtonListcontrol and fixed that groupname problem.

But when ended up happening is when I went to put 2 instances of my new custom radiobuttonlist control on my .aspx page,all was swell until I noticed that every time I checked for radiobuttonlist1.SelectedValue or radiobuttonlist2.SelectedValue (did not matter which I was checking) the value always spit back tring.empty and i was not able to figure out why.

Posted: Mar 25, 2009 07:56 AM

View 3 Replies!   View Related
Web Forms :: Show Radiobuttons When Checkbox Click?
I have a checkbox list in a div control

i want to show one radio button beside one checkbox when i click one check.

[code]....

Posted: Nov 18, 2009 05:06 AM

View 3 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved