|
I have given
<asp:dropdownlist id="ddlStatus" runat="server">
<asp:listitem text="--Select--" value="--Select--" selected="True">
<asp:listitem text="Active" value="1">
<asp:listitem text="Non-Adrenalin" value="0">
When i select In-Active from dropdownlist it saves 2 in the database table.But i have given value as 0 for In-Active.How to solve this??
|
|
|
|
|
Thnx RyanDev.I got it.
|
|
|
|
|
Please copy your code here for what you done to achieve this.
|
|
|
|
|
Thanx for your response.My code is
<asp:dropdownlist id="ddlstatus" runat="server">
<asp:listitem text="--Select--" value="--Select--" selected="True">
<asp:listitem text="Active" value="1">
<asp:listitem text="In-Active" value="0">
when i select "Active" from the dropdownlist, it saves the value '1' and for "In-Active" it saves '2' but i have given value '0' for In-Active.how to solve this?
|
|
|
|
|
try below change in your code:
<asp:DropDownList id="ddlstatus" runat="server">
<asp:ListItem Text="--Select--" Value="" Selected="True" />
<asp:ListItem Text="Active"Value="1" />
<asp:ListItem Text="In-Active" Value="2" />
at code side you have to use Convert.ToInt32(ddlstatus.SelectedValue) to get selected options value.
|
|
|
|
|
I have already given "Convert.ToInt32(ddlstatus.SelectedValue)" in code side.If i give value 2 for In-Active means, it will save 2 in DB ryt....but i want to save value 0 for In-Active in DB. Plz help
|
|
|
|
|
Thank you Dusara Maulik.I got it.
|
|
|
|
|
Selected.Index will give you 0,1,2,3
Selected.Value will give you "", "0", "1"
You should really use "--" for the Select Item Value, and then use the integers for actual values
And validate against "--" for the user to select something.
|
|
|
|
|
Thanks for considering my question.I got the answer
|
|
|
|
|
yes possible
you can check dropdowlist.selectedindex
EX: if(ddl.selectedindex==0)
value=0
else
1
|
|
|
|
|
i want to create a project on event reservation system asp.net using c#....
,so i want help from u that how can i create a best project????
,give me lots of ideas....
|
|
|
|
|
Step 0. Design out what you need.
Step 1. Write the code.
Step 2. Debug.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I'm not sure what you're asking for here. Do you have a specific question? It's hard enough to design an application with lots of information, never mind with no information.
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare
Home | LinkedIn | Google+ | Twitter
|
|
|
|
|
Understand what are the requirements for the project needed and then start the development and let me know where you are stuck.
After understanding the requirements start the db design and the continue the front end development. Ofcourse we are here for you to help
|
|
|
|
|
I understand you want to have what kind of feature your event management system have and how you can make best out of it.
You should post what you already have in your mind and ask if anything more can be added or updated to it.
|
|
|
|
|
|
Greetings experts,
We would like to present a preview page to our users to verify information they had entered before submitting to the database.
I decided to implement this using MultiView control.
However, as soon as I added the MultiView bit, page is no longer display information for users to to complete unless I add ActiveViewIndex="0" to the markup.
Problem is I am already doing so on code behind.
Also, when I enter a value and click Continue>>, the next page is blank as well.
I know I am doing something silly. Your assistance is greatly appreciated.
form id="form1" runat="server" class="ajax_form avia-builder-el-5 el_after_av_textblock avia-builder-el-last " data-avia-form-id="1">
<asp:MultiView ID="myMultiView" runat="server">
<asp:View ID="vwUserInput" runat="server">
<!-- All user textboxes for input here -->
<p class=' form_element_half' id='element_avia_name_1'>
<label for="avia_name_1">Name <abbr class="required" title="required">*</abbr></label>
<input name="avia_name_1" class="text_input is_empty" type="text" id="avia_name_1" value=""/></p>
<p class=' form_element_half_2 form_element_half' id='element_avia_e-mail_1'>
<label for="avia_e-mail_1">E-mail <abbr class="required" title="required">*</abbr></label>
<input name="avia_e-mail_1" class="text_input is_email" type="text" id="avia_e-mail_1" value=""/></p>
<p class=' form_element_half' id='element_avia_company_name_1'><label for="phone_1">Phone</label>
<input name="phone_1" class="text_input " type="text" id="avia_company_name_1" value=""/></p>
<p class=' form_element_half_2 form_element_half' id='eventdate_1'>
<label ID="lblDate" runat="server">Date of Event</label>
<asp:textbox class="text_input is_date" runat="server" ID="txtDate" /></p>
<p class=' form_element_half' id='element_tripType_1'><label for="tripType_1">Trip Type <abbr class="required" title="required">*</abbr></label>
<asp:DropdownList ID="tripType_1" runat="server" class="select ">
<asp:ListItem value="">--Select One--</asp:ListItem>
<asp:ListItem value="one_way_to_airport">One-way trip TO Airport</asp:ListItem>
<asp:ListItem value="one_way_from_airport">One-way trip FROM Airport</asp:ListItem>
<asp:ListItem value="round_trip_airport">Round trip involving Airport</asp:ListItem>
<asp:ListItem value="one_way_no_airport">One-way trip NOT involving Airport</asp:ListItem>
<asp:ListItem value="round_trip_no_airport">Round trip NOT involving Airport</asp:ListItem>
<asp:ListItem value="hourly">Hourly/multi-stop/tours</asp:ListItem>
</asp:DropdownList></p>
<p class=' form_element_half_2 form_element_half' id='element_avia_vprefferred_1'><label for="vpreferred_1">Vehicle Preferred <abbr class="required" title="required">*</abbr></label>
<asp:DropDownList ID="vpreferred_1" runat="server" class="select ">
<asp:ListItem value="">--Select One--</asp:ListItem>
<asp:ListItem value="Chrysler300">Lincoln Town Car (Sedan Black - 4 passenger)</asp:ListItem>
<asp:ListItem value="SportUtilityVehicle">Sport Utility Vehicle</asp:ListItem>
<asp:ListItem value="Stretch Limo : 6 Passenger">Stretch Limo : 6 Passenger</asp:ListItem>
<asp:ListItem value="Stretch Limo : 8 Passenger">Stretch Limo : 8 Passenger</asp:ListItem>
<asp:ListItem value="Stretch Limo : 10 Passenger">Stretch Limo : 10 Passenger</asp:ListItem>
</asp:DropDownList></p>
<p>
<label for="hearaboutus_1">How did you hear about us? </label>
<asp:RadioButtonList id="howyouheard" RepeatColumns = "2" RepeatDirection="Vertical" RepeatLayout="Table" runat="server">
<asp:ListItem value="Facebook"> Facebook</asp:ListItem>
<asp:ListItem value="Returning Customer"> Returning Customer</asp:ListItem>
<asp:ListItem value="Referral"> Referral</asp:ListItem>
<asp:ListItem value="Newspaper Ad"> Newspaper Ad</asp:ListItem>
<asp:ListItem value="Business Card"> Business Card</asp:ListItem>
<asp:ListItem value="Flyer"> Flyer</asp:ListItem>
<asp:ListItem value="Car Magnet"> Car Magnet</asp:ListItem>
<asp:ListItem value="YP.COM"> ALS.COM</asp:ListItem>
<asp:ListItem value="google.com"> google.com</asp:ListItem>
<asp:ListItem value="yahoo.com"> yahoo.com</asp:ListItem>
<asp:ListItem value="Other"> Other</asp:ListItem>
</asp:RadioButtonList></p>
<asp:Button id="SubmitDonate" runat = "server" Text="Coninue>>" onclick="SubmitDonate_Click" />
</asp:View>
<asp:View ID="vwPreview" runat="server">
<!--
Please verify your donation:
<br />
<br />
Name:
<asp:Label ID="lblPreviewDate" runat="server" />
<br />
<hr />
<asp:Button runat="server" ID="finsub" Text="OK" Width="100" onclick="SubmitDonate1_Click" />
<asp:Button runat="server" ID="cansub" Text="Cancel" Width="100"/>
</asp:View>
</asp:MultiView>
</form>
Then codebehind:
Protected Sub Page_Load(sender As Object, e As EventArgs)
If Not IsPostBack Then
SetDefaultView()
End If
End Sub
Private Sub SetDefaultView()
myMultiView.ActiveViewIndex = 0
End Sub
Protected Sub SubmitDonate_Click(ByVal sender As Object, ByVal e As EventArgs)
myMultiView.ActiveViewIndex = 0
End Sub
Protected Sub SubmitDonate1_Click(ByVal sender As Object, ByVal e As EventArgs)
myMultiView.ActiveViewIndex = 1
lblPreviewDate.Text = txtDate.Text
End Sub
|
|
|
|
|
I can't see anything wrong with the code you've posted. Are you sure there's nothing else setting the ActiveViewIndex property?
Try adding a handler to the Activate and Deactivate events on the views. Set a break-point inside the handlers, and look at the stack-trace to see what's changing the view.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi Richard!
Thank you for ever being so helpful. I really appreciate it.
As to why blank is blank on pageLoad, it turns out that all I needed was to add the handler, Handles Me.Load and the controls started loading.
I still can't see why nothing loads when value is entered.
For instance, I entered date and when I click continue>>, page is blank.
|
|
|
|
|
I think you've got your handlers the wrong way round:
vwUserInput (index 0):
<asp:Button id="SubmitDonate" runat = "server" Text="Coninue>>" onclick="SubmitDonate_Click" />
Protected Sub SubmitDonate_Click(ByVal sender As Object, ByVal e As EventArgs)
myMultiView.ActiveViewIndex = 0
End Sub
vwPreview (index 1):
<asp:Button runat="server" ID="finsub" Text="OK" Width="100" onclick="SubmitDonate1_Click" />
Protected Sub SubmitDonate1_Click(ByVal sender As Object, ByVal e As EventArgs)
myMultiView.ActiveViewIndex = 1
lblPreviewDate.Text = txtDate.Text
End Sub
When you click the button on the first page, the event handler sets the active view to the first page, which is already active. Similarly, when you click the button on the second page, it sets the active view to the second page.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
How Richard again!
Is your latest post supposed to be the correct way?
If yes, I think that's what I am using already.
SubmitDoanate1 is for vwPreview which is ActiveIndex=1 and SubmitDonate is for ActiveIndex=0.
Please bear with me sir.
|
|
|
|
|
No, I'm pointing out a potential problem with your code.
The event handler for the button on the first page does nothing except to activate the first page - the page you're already on.
The event handler for the button on the second page activates the second page - which you're already on - and copies a value from a control on the first page to a control on the second page.
It doesn't explain why you're seeing a blank page after clicking the button on the first page, but it's an error that needs to be fixed before your code will work as expected.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Oh, Ok.
Well, I will google the web to try and figure this one out.
As always you are always there to assist.
Thank you very much Richard.
|
|
|
|
|
Hi, we have around 15 .NET 2.0 and .NET 3.5 applications and I've created a new .NET 4.0 app.
I would like to put this with the others on our new web server however when deploying I get an error about duplicate entries in the web.config.
I think it specifically relates to tags like System.Web.Extensions and clashes with the machine.config on the server.
If I remove these tags then I'm sure the error will go away. My question is...what's the best approach here?
Surely removing these tags every time I deploy is not the solution. Should I upgrade all the applications to .NET 4.0? If so, what then? Would I simply remove the duplicate entries from the machine.config rather than the web.config for each deployment?
Can somebody please advise on the best solution moving forward for this problem? Thank you!
|
|
|
|
|
Make sure each application is assigned to an application pool with the appropriate .NET Framework version selected. The 4.0 application should have 4.0 selected; the 2.0 and 3.5 applications should have 2.0 selected.
If your hosting all of the applications in the same site, then you'll need to make some changes to the web.config file:
Changing ASP.NET web.config inheritance when mixing versions of child applications[^]
In particular, you'll need to wrap various sections in the parent application's web.config file in <location> tags:
<location path="" inheritInChildApplications="false">
...
</location>
Try to avoid touching the machine-level config files - you never know whether an update will overwrite your changes.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|