|
1) declare one variable in Javascript
2) set it as 0 by default.
3) write the javascript code
- if chk is checked then
if thisvariable less than 1 then set this variable to 1
else thisvariable is 1 then show the alert("select only one checkbox")
else // chk is unchecked
set thisvariable to 1
4) Add this code in onclick (client-side) event of checkedbox
|
|
|
|
|
beklo.com/rameshgoudd wrote: i have a checkbocxcolumn in the datagrid..
i need to select only one checkbox..and if he selects more than one checkbox...it has to show a message that .."select only one checkbox"
Why don't you have a radio button in that column?
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
Hi,
in the gridview even if you put radio button then it will not solve problem.
Bcoz in grdview it will vreate dynamically radiobutton.
And you cant get result as you can get in simple radiobutton.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Sun Rays wrote: in the gridview even if you put radio button then it will not solve problem.
Bcoz in grdview it will vreate dynamically radiobutton.
And you cant get result as you can get in simple radiobutton.
But with small programming trick, you can do it.
|
|
|
|
|
Sun Rays wrote: in the gridview
DataGrid
Sun Rays wrote: if you put radio button then it will not solve problem
Did I tell that it will solve the problem? Have you ever seen in any web page having a list of check boxes in the same group, when user selects more than one prompting a message saying "don't select more than one". Don't that sort of design defeats the purpose of using Check boxes?
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
Hi Guys,
As I were said,
in datagrid / gridview if putting radio button then that will be in templatefield.
and if you know then its creating radiobutton at runtime for every row.
So cant assign group in that radio button.
So will you be with your radio button everytime ?
What now ? any doubt ?
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
I can understand that Using radio-button in a DataGrid will have the same effect as CheckBox. Will that be a problem if we write a JavaScript function to control the single selection of the radio-button list. There's another alternative too to sort this problem, by Adding a label and dynamically adding HTML input tag as Label Text with type as radio and runat server enabled and with the same group name. This works.
Sun Rays wrote: So cant assign group in that radio button.
Try dynamically adding HTML Server Input Control with type radio and with the same group name.
Sun Rays wrote: So will you be with your radio button everytime ?
Yes, when required.
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
Hi,
John Prabhu wrote: Try dynamically adding HTML Server Input Control with type radio and with the same group name.
Have you tried for this ?
Hope is works fine....
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Sun Rays wrote: Have you tried for this ?
Yes, Radio-Button Column on a DataGrid is the first Design-Template which I coded few years ago...
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
Hello,
I have tried all in V 2 but I didnt find ever that works like group...
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Hello Friends,
How to show the table in center in ASP.NET 2.0............
It's being center in IE but not being in Mozilla .........
Can anybody let me know how it will be?????????
|
|
|
|
|
Does no one has a bit of time to solve my this prob.....
|
|
|
|
|
<!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>
<title>Untitled Page</title>
</head>
<body>
<div style="width:100%;">
<center>
<table style="width:400px;height:200px;" border="2px">
<tr>
<td></td>
</tr>
</table>
</center>
</div>
</body>
</html>
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
|
|
|
|
|
|
Hello all,
I have developed a web application in ASP.Net using C# with login credentials.
I am getting following problem with it.....
I am logging in as user "abc" from one computer in network, its working fine. At the same time, i m logging in as different user say "xyz" on other computer. After this, when i refreshes my "abc" user's page it shows all contents of "xyz" user and hence automatically expires session of "abc".
I am not getting where the actual problem is, please anyone of u can help me with this?
Here is my code......
private void BtnGo_Click(object sender, System.EventArgs e)
{
Label1.Visible=false;
bool persistcookie=true;
if(ValidateUser(TextBox1.Text,TextBox2.Text))
{
//string globalstrConn="Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=iMedia;Integrated Security=SSPI;";
Session["UserName"]=TextBox1.Text;
//This will store the username of the user in this session variable
// We can retrieve this username on different pages by using following code.
// string str=Convert.ToString(Session["UserName"]);
FormsAuthenticationTicket tkt;
string cookiestr;
HttpCookie ck;
tkt=new FormsAuthenticationTicket(1,TextBox1.Text,System.DateTime.Now,System.DateTime.Now.AddMinutes(Convert.ToInt32(ConfigurationSettings.AppSettings["timeout"])),persistcookie,"Your Custom Date");
cookiestr=FormsAuthentication.Encrypt(tkt);
ck=new HttpCookie(FormsAuthentication.FormsCookieName,cookiestr);
if(persistcookie)
ck.Expires =tkt.Expiration;
ck.Path =FormsAuthentication.FormsCookiePath;
Response.Cookies.Add(ck);
string strredirect;
strredirect=Request["ReturnUrl"];
if(strredirect==null)
strredirect="login.aspx";
Response.Redirect(ConfigurationSettings.AppSettings["defaultpage"],true);
}
else
{
Label1.Text="Invalid Credentials!";
Label1.Visible=true;
// Response.Redirect("login.aspx",true);
}
}
Please someone help me.
Thanks,
Nagendra.
|
|
|
|
|
Hi all!
I have such problem with IIS 6.0 configuration.
I have a web site with HttpHandler inherited class which catch all requests. When I publish this site on IIS 6.0 and try to launch this application by entering
"http://mydomain.com/test-www;par@act=value&Parameter=mypar" my site doesn't catch this request and IIS returns Bad Request (400) error
May be RFC 1738 Url Standard works here and IIS can't obtain such requests. But may be there is a way to solve this problem
Thank you very much in advance
-- modified at 4:42 Thursday 29th November, 2007
|
|
|
|
|
IIS 6 has a wildcard mapping setting that is designed specifically to process requests that don't map to a specific file (i.e. a request with no file extension). When you configure your web site/app, click on the configuration button under the application settings. Under the application mappings, you should see a wildcard mappings section as well. Map the wildcard request to the aspnet_isapi.dll and make sure that it doesn't require that the file exist. That should solve your problem.
|
|
|
|
|
Hi All,
I have one doubt i have a data container class Applicant.i have created many objects of other classes like PersonalInfo,Employment..... etc
in the constructor of applicant.
Now the question is there any performace issue while using these 2 sentnces
string Address = applicantObject.PersonalInfo.Address;
Or should do in another way
PersonalInfo personalInfoObject=applicantObject.PersonalInfo;<br />
string Address=personalInfoObject.Address;
Is there any perforamance between 2
Address is a property it might have many properties
Can any one give me the link where i can read performance issue for this type
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Option 2 creates another reference to a class, or another copy of a struct. Either way, this is not going to have a huge hit.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Chris,
Thanks for reply, Here all are reference type(Class) so you are right option 2 creates pointer to same memory.
Christian Graus wrote: Either way, this is not going to have a huge hit.
Is CLR is going to call these 2 sentences in same way ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I don't think this would be a performance issue.
playing with bugs ) wrote: string Address = applicantObject.PersonalInfo.Address;
This will create a memory space for address and store the value.
playing with bugs ) wrote: PersonalInfo personalInfoObject=applicantObject.PersonalInfo;
string Address=personalInfoObject.Address;
This will create another location on the stack and refer to the specified object. In this also new location for string would be created. This won't be a big performance issue.
|
|
|
|
|
Hey Navaneeth !!!!!
Thanks for you valuable comments.
But if you see the how CLR going to call these 2 sentences i think that makes the difference
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
playing with bugs ) wrote: But if you see the how CLR going to call these 2 sentences i think that makes the difference
I am not getting how this can make a performance difference ? What made you to think so ?
|
|
|
|
|
Just wanted to know is there performace issue in it.
i think you are right there is not much difference in both
Thanks
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Although, if it makes any extra performance, it would be very less and negligible. Those two are two types of approach to the problem.
|
|
|
|