|
protected void Button5_Click(object sender, EventArgs e)
{
ChildNode("ABC");
}
[ParentNode is Node Name in Which u want to add Child]
public void ChildNode(string ParentNode)
{
foreach (TreeNode tn in TreeView1.Nodes)
{
if (ParentNode.Contains(tn.Value.ToString()))
{
TreeNode tnchild = new TreeNode();
tnchild.Text = "Jintal";
tnchild.Value = " Vlaue";
tn.ChildNodes.Add(tnchild);
}
}
}
Jintal Patel
|
|
|
|
|
Hi...
I am using a dropdown list with autopostback = true. I am performing validation using JavaScript with the fallowing function
function ddlCheck()
{
var dt = document.getElementById("<%= ddlClassRoomNo.ClientID%>").value;
if (parseInt(dt) != 0)
{
return true
}
else
{
alert('Select a value')
return false
}
}
i am calling this with setting attributes to the control on the page load event just like this
ddlClassRoomNo.Attributes.Add("OnChange", "return ddlCheck();")
it works fine but when the condition is true the AutoPostback is not happening
how can i solve this.
Thanks in Advance
|
|
|
|
|
try this:
if (parseInt(dt) != 0)
{
Form1.submit();
}
|
|
|
|
|
Hi..
Thanks. I checked the code but it is not working
|
|
|
|
|
It does not work with drop downlist even though you retrun true postback will not occure
-- modified at 8:34 Wednesday 26th September, 2007
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... "
|
|
|
|
|
What's the Difference between an asp:Literal control and an asp:Localize control? I fail to see any difference either on the Designer, Page or Html Source
So what's the difference? What's the added value for localization?
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
|
|
|
|
|
The Localize control is identical to the Literal Web server control and its inherited from Literal control.
For a literal control, We can set the property either at design time or programaticaly.But for localize control, we can set only at runtime.
with regards,
lavanya
|
|
|
|
|
Hi,
Hope every one is fine. i am building a web site in ASP.NET 2.0 and C#. i want to update my stored procedure at runtime according to user's choice. is it possible?
i found some code which does this but it doesnt change the procedure physically, i mean it changes at runtime but when i stop application it again shows the old command text. Kindly guide how can i perform this task.
Thanks in advance...
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Affan Toor wrote: i want to update my stored procedure at runtime according to user's choice. is it possible?
Strange. Why you need this ? if you are updating stored procedure dynamically, better to use query directly.
If you want to do this, write procedure creation code in SQLCommand and execute it. If procedure exist drop it and exete the create procedure statements.
|
|
|
|
|
Thanks for reply, my problem is solved!
i found a way to dynamically change the contents of stored procedure. actually we can not pass a query directly to crystal report at runtime, thats why i wanted to pass query to stored procedure at runtime and then execute that procedure in crystal report.
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Hi
Can please someone help me out with this problem ...
I have developed a Treeview using Microsoft TreeView control in ASP.NET using C#. Its working perfectly in the Internet Explorer.
The problem im facing is that its not working in Mozilla as its not able to attach javascript event handlers to the treenodes.
The javascript events have been attached via the C# code behind file rather than html.
eg.this.TreeCtrl.Attributes.Add("onexpand","javascript:return treeViewExpand(this);");
Can someone please help me in how to attach the treenode events so that they work perfectly for Mozilla browser.
|
|
|
|
|
Hi All,
I m using one datagrid . Each record of datagrid contains checkbox. There is one button outside the Datagrid. If i click that button then all the checkbox should be checked and also confirmation msg should be display . Is there any javascript for this ? or any coding(C#)?? plz help me.
Thank you
Keep Smiling............
|
|
|
|
|
Yes use this script:
function check_uncheck(Val)
{
var ValChecked = Val.checked;
var ValId = Val.id;
var frm = document.forms[0];
// Loop through all elements
for (i = 0; i < frm.length; i++)
{
// Look for Header Template's Checkbox
//As we have not other control other than checkbox we just check following statement
if (this != null)
{
if (ValId.indexOf('CheckAll') != - 1)
{
// Check if main checkbox is checked,
// then select or deselect datagrid checkboxes
if (ValChecked)
frm.elements[i].checked = true;
else
frm.elements[i].checked = false;
}
else if (ValId.indexOf('deleteRec') != - 1)
{
// Check if any of the checkboxes are not checked, and then uncheck top select all checkbox
if (frm.elements[i].checked == false)
frm.elements[1].checked = false;
}
} // if
} // for
} // functionNow the Delete confirmation method:
On button Click call this
<asp:Button ID="CheckAll" Text="Check all" onclick="return check_uncheck (this );"
runat="server" />
Hope this helps u??
|
|
|
|
|
vhs17 wrote: Is there any javascript for this ? or any coding(C#)??
Yes. There are lot of Examples are hereitself.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
foreach (GridViewRow gdvRow in ResultsGrid.Rows)
{
CheckBox objCheckBox = (CheckBox)gdvRow.Cells[columns].Controls[1];
if (htmlCheckBox.Checked == true)
{
}
}
|
|
|
|
|
HI TRY THIS SCRIPT IF YOU WANT TO CHECK ALL CHECKBOXES ON CLICK OF BUTTON
for (var i = 0; i < e.form.elements.length; i++) <br />
{<br />
if (e.form.elements[i].name == "CHKNAME")<br />
e.form.elements[i].checked = true;<br />
<br />
}<br />
}
bEST rEGARD
pATHAN
---------------------------------------------------
|
|
|
|
|
pass the datagrid name via the codebehind: btnCheckAll.Attributes.Add("OnClick","javascript:return CheckAll("dgdGrid");");
function CheckAll(dataGridName)
{
var ChkState = true;
//count the no. of rows in the DataGrid List
var count = document.getElementById(dataGridName).rows.length;
for(i = 2;i<=count+1; i++)
{
var id = dataGridName+"__ctl" + i + "_chkSelect";
var elem = document.getElementById(id);
elem.checked = ChkState ;
}
}
where "chkSelect" will be the name of the checkbox as mentioned in the item tempelate column in the html code for the datagrid.
Hope this helps !!
|
|
|
|
|
Thank you All..........
|
|
|
|
|
Hi
I'm trying to move the selected item from listbox1 to listbox2. but the condition is tat if the selected item of listbox1 does not exists in listbox2 only then that particular item should be added to listbox2
Thanks in advance
Regards
G...
|
|
|
|
|
What is the problem ?
Before adding to listbox 2 check the item is already added to it if no then add
atleast first try
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... "
|
|
|
|
|
iterate through each item of first box using foreach loop and check if that item is there in box two, if not there add it. you will need to use two nested foreach loop to acomplish this.
People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily
Akhilesh Singh
|
|
|
|
|
Try out this code and check,whether its answers ur question. U can use this for both single item and multiple item move.
Dim i As Integer
Dim j As Integer
Dim n As Integer
For i = 0 To ListBox1.Items.Count - 1
n = 0
If ListBox1.Items(i).Selected = True Then
For j = 0 To ListBox2.Items.Count - 1
If ListBox2.Items(j).Text = ListBox1.Items(i).Text Then
n = 1
End If
Next
If n <> 1 Then
ListBox2.Items.Add(ListBox1.Items(i).Text)
End If
End If
Next
with regards,
sudha
|
|
|
|
|
Thanks Madam.. its really working fine
|
|
|
|
|
Hello all,
I have a multiview with two views. on click of one button I need to change activeviewindex of multiview with clientclick event of this button(java script function to handle this). i have a server side click event too for the same button, after clientside event changes the activeindex of multiview, my server side event will work with the current active index(which is changed through javascript).
So i just want to change activeviewindex of a multiview from javascript.
is there any way to do this? Any idea will be helpful...
People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily
Akhilesh Singh
|
|
|
|
|
hi friends
In enterprise library 2.0 contain the class and dll..
which one i will use the program.
another query is:
it contain multiple classes.
For example,cacheblock contain multiple class.which class should i use program
regards
saravanan
|
|
|
|