|
How can I add new values to checkboxlist control of ASP.NET?
I have done this by dropdown and listbox controls before but it's several days that I can't do this task.
Please help me everyone.
|
|
|
|
|
|
Hi sir!!
I said in JAVASCRIPT.
|
|
|
|
|
You are right!
Here is a JavaScript sample.
Markup Part:
=========
<head runat="server">
<script type="text/javascript">
function AddMoreItems()
{
var newNode = null;
var objList = document.getElementById('CheckBoxList1');
if (objList != null)
{
var tblBody = objList.getElementsByTagName('TBODY');
newNode = tblBody[0].rows[tblBody[0].rows.length-1].cloneNode(true);
if (newNode != null)
tblBody[0].appendChild(newNode);
}
return false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:CheckBoxList ID="CheckBoxList1" runat="server">
</asp:CheckBoxList>
<asp:Button runat="server" Text="Add" ID="submitBtn" />
</div>
</form>
</body>
Code Behind Part:
=============
protected void Page_Load(object sender, EventArgs e)
{
CheckBoxList1.Items.Add(new ListItem("Hello"));
CheckBoxList1.Items.Add(new ListItem("Welcome"));
submitBtn.Attributes.Add("onclick", "return AddMoreItems();");
}
I hope you got some idea!
Enjoy!
P.Anbuselvan
IT Consultant
Emirates Group IT, UAE
|
|
|
|
|
Hi,
You can add ListItem to CheckBoxList in Javascript:
<asp:checkboxlist id="Check1"
="" repeatlayout="flow" runat="server">
<asp:listitem>Item 1
<asp:listitem>Item 2
<asp:listitem>Item 3
<asp:listitem>Item 4
<asp:listitem>Item 5
<asp:listitem>Item 6
Regards,
Blumen
|
|
|
|
|
|
Hi there,
I am creating a web application which uses the login controls in Visual Studio.
This application has an administrator who has the rights to change anybody's password. How can I do this in the code. I mean how do I access the password of another user.
Thanks for all your time and help.
You don't have to be AFRAID!
|
|
|
|
|
Hi,
U can get password for another user the same way as u get it for the administrator to authenticate him when he logs in the system.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Hi there,
I am creating a web-application which has a lot of data in it.
Which option would be better.
1. Using the wizards in ASP.NET or
2. Writing a middle tier DBConnect class to handle the ADO.NET.
Thank you.
You don't have to be AFRAID!
|
|
|
|
|
Hi,
Using middle tier class is better.
Regards,
Blumen
|
|
|
|
|
Hello, i want someone to help me, i want to create a confirmation dialg with asp.net
how can i do
thinks
|
|
|
|
|
hi there,
you might search for window.confirm(...) javascript method to see how to use it
<< >>
|
|
|
|
|
how to edit the values with in the datagrid.
means...
when we r clicking edit button in grid then that particular row automatically have to change as textboxes or any but it has to editable.
reply me...
thanks.
|
|
|
|
|
|
I created a simple application say "LoginApp" that checks a users credentials using the Web Site Administration Tool. Everything works fine and when I log in, I can view the users username and Role ie: admin, Administrator
I created another application say "App1" that uses LoginApp as it's login. Everything works fine as long as you add similar machine keys, authorization settings in the web.configs of all apps that are using the login ie:
<machineKey
validationKey="6AE8AE0D7BA0654392821F2B5B0F209E32492B6ABD47AABBD4CB4B1ABEDE7D66B9F78A8DC174B352183726D3AB682B5E7BB37BD2010E283ADBDB4024DE87B440"
decryptionKey="C5F9FF5E81B780DEBA8B41C41D4830F27139DB1CD373FDDAABF0648D24D8F3E2"
validation="SHA1" decryption="AES"
/>
<authorization>
<deny users="?" />
</authorization>
<roleManager enabled="true" />
<authentication mode="Forms">
<forms name=".AUTH" loginUrl="/LoginApp/Login.aspx" protection="All" path="/" timeout="30"/>
</authentication>
This approach works, but I can only extract the Username. All the role information is lost. Roles.GetAllRoles, Roles.GetRolesForUser returns empty strings. Any suggestions in getting this fixed?
|
|
|
|
|
hi
i write this JavaScript Code for change Text of my label :
Function lbl_Waint()
{
document.getElementById("lbl_status").setAttribute("Text","Sending ...");
}
and in OnClientClick of my button write this code :
OnClientClick="lbl_Waint();true"
but it doesn't work, how to solve my prblem ?
thanks
|
|
|
|
|
You are confusing the server control with the html elements that it renders. A label will be rendered as a span tag, and a span tag has no Text attribute.
Use the innerHTML property of the element to change it's text.
---
single minded; short sighted; long gone;
|
|
|
|
|
thanks for reply,
i change my code by your suggestion as follow :
document.getElementById("lbl_status").innerHTML = str;
but does't worked again.plz write full example of this problem,thanks
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
Standard question #2:
What error message do you get?
Full example:
document.getElementById('lbl_status').innerHTML = 'Sending...';
Have you verified that the id of the generated element is correct?
---
single minded; short sighted; long gone;
|
|
|
|
|
I think, lbl_status is server control.
So, Try the following way
document.getElementById('<%= lbl_status.ClientID.ToString() %>').innerHTML = 'Sending...';
Regards
R.Arockiapathinathan
|
|
|
|
|
I am currently designing an .aspx web app. I have a web form with header and detail. im using the unbound datatable to capture the detail data from the user.
i have a Save routine which passes the header and detail datatable to the middle tier. The middle tier passes same through an sql server 2005 stored procedure.
My problem is that, I want to use a transaction to catch any error that may occured either while updating the header or while iterating the detail data.
Any syntax will help.
Also will the transaction be able to rollback the Header data, if there is an error during iterating and updating the detail table since im using 2 stored procedure, 1 for header and 1 for detail?
t.aransiola
|
|
|
|
|
Each of your updates called with a adapter. You have to add all of them to ONE SqlTransaction , so search for SqlTransaction and you will find some examples about how to user it.
Mazy
"This chancy chancy chancy world."
|
|
|
|
|
could any one help me with how i can use a datepicker control in asp.net?
t.aransiola
|
|
|
|
|
Just Drag and drop that Date picker control to your design page of aspx page.
Regards,
Satips.
|
|
|
|
|
I think dt picker control is not availabe in asp.net.
Bcos , I have installed VS2005, and I do not find this control in
my toolbox.
Please let me know, if I am wrong.
Regards,
Arun Kumar.A
|
|
|
|