|
I had written a example for you :
<br />
<script language="javascript"><br />
function Test(objSource)<br />
{<br />
for(var i = 0;i< objSource.childNodes.length;i++)<br />
{<br />
var obj = objSource.childNodes[i];<br />
if(obj.tagName != null <br />
&& obj.tagName.toLowerCase() == "input" <br />
&& obj.type.toLowerCase() == "checkbox")<br />
{<br />
alert(obj.id);<br />
}<br />
else<br />
{<br />
Test(obj);<br />
}<br />
}<br />
}<br />
<br />
function GetIDs()<br />
{<br />
var objSource = document.getElementById("CheckBoxList1");<br />
Test(objSource);<br />
}<br />
</script>
-- modified at 8:34 Monday 13th August, 2007
learning english
|
|
|
|
|
hello everyone,
I have a small problem in CheckBoxList control in asp.net.
When i take checkboxlist of 2 items.When i Click on the second item checkboxlist, i should get an an alert message showing that this selection is not acceptable.To do this we have use javascript only but not with the checkboxlist_selectedchanged event ,that alert message should fire when i click on the button.Plz anyone help me fast this is urgent for me.
ok byeee
Murali
|
|
|
|
|
Hi, You want to select only one item from your checkboxlist??
If yaa then
use RadioButtionList.
Naresh Patel
|
|
|
|
|
Hi,
I have an asp:Repeater and need to add an asp:DropDownList in it (i.e. nested).
The asp:Repeater works but not the asp:DropDownList.
<code>
Sub R1_ItemDataBound(Sender As Object, e As RepeaterItemEventArgs)
Dim ds As New DataSource
Dim data As New DataSet
data = ds.GetDataFunction
If (e.Item.ItemType = ListItemType.Item) Or _
(e.Item.ItemType = ListItemType.AlternatingItem) Then
Dim a As DropDownList = e.Item.FindControl("ddl")
a.DataSource = data1
a.DataValueField = "ID"
a.DataTextField = "name"
a.DataBind
End If
End Sub
</code>
And the html code
<code>
<asp:DropDownList id="ddl" runat="server" OnItemDataBound="R1_ItemDataBound" />
</code>
The DropDownList shows but it is not populated. What am I doing wrong?
Thanks.
Desmond
|
|
|
|
|
sandrider wrote: a.DataSource = data1
Use like,
a.DataSource = data1.Tables(0)<br />
<br />
or <br />
<br />
a.DataSource = data1.Tables(TABLE_NAME)
DataSet is a collection of Data Table, but you can assign the DataTable as a DataSource. Try the above code.
|
|
|
|
|
Hi Venkatesh,
Thanks for your help but it didn't work. I've found the problem.
Desmond
|
|
|
|
|
I think You should bind "R1_ItemDataBound" event on the ItemDataBound of the repeater control.so that dropdownlist will get populated for each item in the repeater control.
You made a mistake by binding "R1_ItemDataBound" to the OnItemDataBound of the DropDownList "ddl"
Regards
John
-- modified at 9:31 Monday 13th August, 2007
|
|
|
|
|
|
Hello all,
I am working on ASP.net 2005 web developer edition. I am unable to switch to design view. i tried by right clicking on the aspx page but there the design view is disabled. Please help me to find out the problem.
Thanks in Advance
Bharath.S Ron
|
|
|
|
|
Is there any error displaying when you right click and select view designer?
If yaa then first solve it and then try.
Otherwise I don't know.
Naresh Patel
|
|
|
|
|
Hi,
I want to do a bulk insert of around 25k records into sqlserver databse .
I am using asp.net1.1
thanks
|
|
|
|
|
rajmani wrote: I want to do a bulk insert of around 25k records into sqlserver databse .
for(int i=0;i<=YourValue;i++)
{
}
|
|
|
|
|
Hi!
how can i Foucs on a Text Box using javascript?
|
|
|
|
|
document.getElementByid("TextBoxID").focus();
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
We usually do something like this:
<script><br />
<br />
function LoadFocus(){<br />
<br />
document.getElementById('<%= <TextBoxName>.ClientID %>').focus();<br />
document.getElementById('<%= <TextBoxName>.ClientID %>').select();<br />
<br />
}<br />
<br />
window.attachEvent("onload", LoadFocus);<br />
<br />
}<br />
<br />
</script>
This will work for IE, but not sure about attachEvent for ff...would have to check if required.
|
|
|
|
|
daniel__c wrote: document.getElementById('<%= .ClientID %>').select();
Why do we need to do that?
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Sorry, that should be
document.getElementById('<%= <TextBoxName>.ClientID %>')
not
document.getElementById('<%= .ClientID %>') as originally posted.
We usually do the .select() to select any text that is currently in the text box. You can do the focus alone, but the select tends to be a bit more user friendly.
|
|
|
|
|
Hi everyone,i'm a NOOB in asp.net and am stuck with a problem. so please, Please don't laugh at me.
right now, i'm working on a project which requires me to select several data from the database, then display all in 1 cell. how do i achieve that?
is it possible to keep the selected data in an array and display the array?
http://i4.photobucket.com/albums/y138/veracia/ideal.jpg
this will be my ideal outcome.
all answers and comments and help appreciated!
thanks!
veracia
|
|
|
|
|
Table Cell or Grid Cell ?
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
table cell
oh yes, i'm using sql server and VS2005.
|
|
|
|
|
Create lable control at run time add it into cell of table liek.
Get specified cell where u want to add.
Lable obj=new Lable();
obj.Text=Record('field1);
Cell.controls.add(obj);
Lable Obj2=new Lable();
obj2.Text =record("field2");
Cell.controls.add(obj);
...........
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
Hi, thanks for your prompt reply.
However, I get the error "Record" doesn't exist in the current context.
|
|
|
|
|
I am using datalist control and want to perform paging for the data source..How to perform it
|
|
|
|
|
|
hi all,
I used Below methods but I am not getting visitors IP.It always shows internal IP.My server having Secure Socket Layer.
Request.ServerVariables("HTTP_X_FORWARDED_FOR") //return empty
Request.ServerVariables("REMOTE_ADDR") //got my internet IP
Request.UserHostAddress //got my internet IP
I dont know how to solve this.Is SSL is hiding the visitor IP? When I set deny access IP address in IIS it is working.Actually I want to put access using the visitor IP.How to do this.
Pls advice
Thanks in Advance.
|
|
|
|