|
Hi all
I have a user control with textbox fields to enter the address.
If the fields are empty, the validation summary will be displayed.
There is one checkbox on the control to fill up the text boxes if it is checked in.
When the validation summary is available on the page, and I click on the checkbox, to automatically fill the text boxes, it does not work.
Server side event is not getting fired when I check and uncheck the checkbox for the first time when validation summary is available on page.
I added, client side to event to CheckBox and then called __doPostBack event from the javascript. But postback is not happening.
I have following javascript
function OnCheckClick()
{
__doPostBack('SameAddressCheckBox','');
}
When I used the above script on "onclick" event of checkbox, after validation summary appears on page, when I try to check in the checkbox, validation summary goes away, but the checkbox is not getting checked in and server side event is also not called.
can anyone please suggest some thing so that postback can happen and will call serverside event.
Many thanks.
|
|
|
|
|
you do not need javascript in this case
CheckBox has properties AutoPostBack and OnCheckChanged.
in your ASPX something like
<asp:CheckBox runat="server" ID="chkTest" AutoPostBack="true" OnCheckedChanged="chkTest_OnCheckedChanged" />
in your ASPX.cs something like
protected void chkTest_OnCheckedChanged(Object sender, EventArgs e)
{
if (chkText.Checked)
{
// your code
}
else
{
// your code
}
}
Good Luck
|
|
|
|
|
Good Evening All
i have Link Buttons, when i test them localy they work, but after i Deployed my Site, The Link Buttons dont work. They look like just ordinary text. Here is the Site
http://www.TiyaneProperties.co.za/Tiyane/Home.aspx[^]
and Here is the Code in my Asp.NET Page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Home.aspx.cs" Inherits="index" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Welcome to Tiyane Properties-Experience the Difference</title>
<script language="javascript" type="text/javascript">
function TABLE1_onclick() {
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<img src="Images/Tiyane_banner.gif" /><br />
<br />
<br />
<br />
<table>
<tr>
<td style="width: 128px; height: 21px">
<asp:LinkButton ID="btnGauteng" runat="server" OnClick="btnGauteng_Click">Gauteng</asp:LinkButton></td>
</tr>
<tr>
<td style="width: 128px">
<asp:LinkButton ID="btnNorthWest" runat="server" OnClick="LinkButton2_Click">NorthWest</asp:LinkButton></td>
</tr>
<tr>
<td style="width: 128px">
<asp:LinkButton ID="btnMpumalanga" runat="server" OnClick="btnMpumalanga_Click">Mpumalanga</asp:LinkButton></td>
</tr>
<tr>
<td style="width: 128px">
<asp:LinkButton ID="LinkButton4" runat="server" OnClick="LinkButton4_Click">Contact Agents</asp:LinkButton></td>
</tr>
<tr>
<td style="width: 128px; height: 28px">
<asp:LinkButton ID="btnaboutus" runat="server" OnClick="btnaboutus_Click">About us</asp:LinkButton></td>
</tr>
</table>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="background-color: #ff3333"></span>
<div class="footer">
<span style="background-color: #ff3333"></span>
</div>
<br />
<br />
<br />
<asp:Label ID="Label1" runat="server" ForeColor="Red" Text="Copyright © 2008 Tiyane Properties cc. All rights reserved. "></asp:Label><br />
</div>
</form>
</body>
</html>
What is Wrong?
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
What program are you using to develop your pages, i did not saw something like your first line of code(markup),and did you check your codebehind?
I Wish the Life Had CTRL-Z
Wizard's First Rule : People are fool,they believe what they want to believe or what they afraid to believe
www.subaitech.blogspot.com
|
|
|
|
|
hi
thanks for your reply
Am using VS2005
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi,
I am trying to dyanimaclly generate 2 radio button in a grid. On that says "Yes" and one that says..........wait for it......"No". =D ( A radio button list would work better).
I need to create this dynamically in code and I have not been able to find a decent tutorial to help me on this.
I am also wondering, since I will be asking later anyways, if there is a way to do this, how do you handle their events.I need to know the row in which those radio buttons are located when the clicked even is triggered to proceed with other code.
Any help would be appreciated, Ive been banging my head on the wall for this one
If you have any question about this, lemme know to see if I can make it clearer
Thanks,
Mickey
|
|
|
|
|
hellbinder wrote: Any help would be appreciated, Ive been banging my head on the wall for this one
I recommend you stop banging your head against that wall, or anything else for that matter, it seems unproductive. Perhaps you could spend your time read some programming material that is intended to impart programming knowledge to the reader.
hellbinder wrote: how do you handle their events.
Like this:
someobject.someevent += someeventhandler;
led mike
|
|
|
|
|
led mike wrote: someobject.someevent += someeventhandler;
Hmmmm. Thanks for the advice. But the handler part where I am not sure of is how to find out the row that it was clicked on. Im doing a dynamic gridview.
And still the question is, how do I (in code) add a radio button list ina column and know what row it was clicked on.
Thx
|
|
|
|
|
Well I now understand that your question was NOT how to subscribe to the event.
Unfortunately I still can't understand what you are trying to accomplish. Maybe this article will help you.[^]
led mike
|
|
|
|
|
led mike wrote: Unfortunately I still can't understand what you are trying to accomplish.
Ok, I'm going to try to make this as clear as possible
I am creating a gridview dynamically. By this I mean, I am completely designing this gridfrom scratch programatically and then adding it to the form. I have a couple of rows in which case are bounded fields. These fields are easy to add to the gridview so it shows the information necessary. In one column I need to add a radiobuttonlist. This, i'm guessing needs a templated column to be able to add the control just like it's done in design time. I am having trouble finding how it's possible to add the templated column to the grid view and then create a radiobuttonlist to add to the column. All of this done programatically since in design nothing exists except the form.
From there another problem that I'm sure I'll get to is, when the control is where it's supposed to be and I have the event subscribed to it, I will need the row in which the radiobuttton list is on.
Hopefully this clears something up. Let me know. And yes, I have been trying to find out information about this, but nothing helpfull has come up yet.
-Mickey
|
|
|
|
|
this might do the trick
<asp:TemplateField>
<ItemTemplate>
<asp:RadioButtonList ID="rblItems" runat="server" AutoPostBack="true" OnSelectedIndexChanged="rblItems_OnSelectedIndexChanged">
<asp:ListItem Text="Yes" />
<asp:ListItem Text="No" />
</asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateField>
In your Code Behind you do something like
protected void rblItems_OnSelectedIndexChanged(Object sender, EventArgs e)
{
if (rblItems.SelectedIndex.Equals(0))
{
}
else if (rblItems.SelectedIndex.Equals(1))
{
}
}
Good Luck
|
|
|
|
|
I have a gridview with a template column.in this template, I put an upload control and a button and a label.I want to upload picture for every row.but when I double click on the button to write the codes for upload , I don't see the control's Id that I have been defined for that controls in smart list.and see this error:CS0103: The name 'uploadtest' does not exist in the current context
|
|
|
|
|
Because your button will be created for every row of the gridview, it will not exist with that name, each button will have it's own name, I believe. I never use the designer anyhow, it sucks. In this case, just go to the code view and add an OnClick handler manually.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I could not understand your meaning.how should I add manually?
|
|
|
|
|
By typing in actual code instead of using the designer.
By the way, if you reply to me, I get an email. If you reply to your self, I don't. And, I may not even notice that you replied to me, it looks like someone else replied to you.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
can you give me some resorce for this subject.your answer is dusty
|
|
|
|
|
hello guys...
I've just finished my personal web site by using ASP.NET 2.0 and I wanna upload my site to any web hosting.. so anyone know a free web hosting that provide ASP.NET 2.0 ... (FREE) without any fees??????
and I wanna ask about is there any way to upload my site by FTP in Visual Studio????????
thanks alot..
|
|
|
|
|
|
|
Genius.Boy wrote: ASP.NET 2.0 ... (FREE)
Doubt it. This google search[^], cheapest is $3.95/month or so. Surely you could afford that
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Thanks alot Mr. Paul
so I have no way.... I have to pay
thanks again
|
|
|
|
|
Genius.Boy wrote:
I mean $2.95-3.95/month isn't bad. I am paying $8/month for my severice with www.bluedomino.com[^] and it is okay... Will your ISP let you host your own site?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
paul Im just kidding ... I don't have any problems in paying but I just asked about free hosting because Im new in ASP.NET and I just wanna try uploading my small web site just testing...
I think I will use the blue domain in the future after being professional in ASP.NET hahaha
thanks paul
|
|
|
|
|
Not sure if you can do ASP.NET with bluedomino. They run *nix...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi,
I have a textbox in which user can enter some text. when user stop typing for a while then it should trigger a method...
If anyone knows the solution please help me..
modified on Monday, December 15, 2008 7:23 PM
|
|
|
|