|
Write this Question in General database forum...........
|
|
|
|
|
foreach (GridViewRow rw in this.grdEmpSearch.Rows)
{
ChkBox =(CheckBox(rw.Cells[0].FindControl("chk"));
if (ChkBox.Checked)
{
chkCount++;
}
}
i wrote the above code to check whether the checkbox inside a grid is checked or not but although the checkbox is not checked the above code is returning checked true is all the cases....
|
|
|
|
|
I haven't down-voted you for the one I replied before this because I didn't see the other two posts' content.
Now my 1-vote!
..Go Green..
|
|
|
|
|
foreach (GridViewRow rw in this.grdEmpSearch.Rows)
{
ChkBox =(CheckBox(rw.Cells[0].FindControl("chk"));
if (ChkBox.Checked)
{
chkCount++;
}
}
i wrote the above code to check whether the checkbox inside a grid is checked or not but although the checkbox is not checked the above code is returning checked true is all the cases....
|
|
|
|
|
Use this
int checkedCount = 0;
foreach (GridViewRow row in gvData.Rows)
{
bool result = ((CheckBox)row.FindControl("CheckBox1")).Checked;
if (result)
{
return true;
}
else
{
return false;
}
}
|
|
|
|
|
foreach (GridViewRow rw in this.grdEmpSearch.Rows)
{
ChkBox =(CheckBox(rw.Cells[0].FindControl("chk"));
if (ChkBox.Checked)
{
chkCount++;
}
}
i wrote the above code to check whether the checkbox inside a grid is checked or not but although the checkbox is not checked the above code is returning checked true is all the cases....
|
|
|
|
|
Already posted in Q&A section.
..Go Green..
|
|
|
|
|
When the code is not separated to index.aspx and index.aspx.vb
but all the code aspx and vb in the same page index.aspx
where I can but the code such as :
Imports system.IO
|
|
|
|
|
<%@ Import Namespace="myNamespace">
Try this..
|
|
|
|
|
Thanks .
But this error is occurred:
Parser Error Message: The server block is not well formed.
|
|
|
|
|
k try this
<%@ Import Namespace="system.IO" %>
|
|
|
|
|
You have missed server side tage closing character "%>" ( you have provided ">" only )
Thanks,
Arindam D Tewary
|
|
|
|
|
i do have 2 gridviews in my page, both of which contains check boxes. i need to uncheck and enable second gridview when any of the checkbox from first gridview is selected and vice versa.
|
|
|
|
|
Here is a demo example, i m takin two grids and than disabling and enabling the second one through checkbox click in first one through javascript.
.aspx code
<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<input type="checkbox" id="chkitemheader" name="chkitemheader" onclick="SelectAll('chkitemheader');" />
<ItemTemplate>
</asp:TemplateField>
<Columns>
</asp:GridView>
<asp:GridView ID="GridView2" runat="server" style="visibility:hidden;">
</asp:GridView>
Javascript:-
function SelectAll(id) {
if(document.getElementById(id).checked)
{
var grid = document.getElementById("<%= GridView2.ClientID %>")
grid.style.visibility = "visible";
}
else {
var grid = document.getElementById("<%= GridView2.ClientID %>")
grid.style.visibility = "hidden";
}
}
</script>
modified on Friday, May 7, 2010 4:00 AM
|
|
|
|
|
thanks , but i need to enable asp.net checkbox inside gridview .
|
|
|
|
|
1. You need to put a javascript function in each checkbox in row in first gridview. in that checkbox you call the javascript function as follows
<asp:checkbox ...... OnClientClick = "return EnableBelowGrid(this.id)" />;
2. Following would be your javascript function defination
function EnableBelowGrid()
{
var chkBoxID = arguments[0];
if(document.getElementByID(chkBoxID).checked)
{
document.getElementById('<%=BelowGridID.ClientID%>').disabled = true
}
return false;
}
Assumed that "BelowGridID" is the ID of your below grid as you have refered.
Thanks,
Arindam D Tewary
|
|
|
|
|
je ss un etudiant comme CDA creation et développement des application intranet Extranet et mon projet de fin d etude et un mélange entre forum de discussion et site des cours numériser et cours video upload et download ben si quilqu un peu m aider si il vous plez
|
|
|
|
|
mouadel wrote: je ss un etudiant comme CDA creation et développement des application intranet Extranet et mon projet de fin d etude et un mélange entre forum de discussion et site des cours numériser et cours video upload et download ben si quilqu un peu m aider si il vous plez
What is this ? Can you please write it in English ?
|
|
|
|
|
It appears to be txt-speak French. Interesting, haven't seen that before. Asking for help with a final year project I think?
I'd rather set a challenge for an application that could translate that.
|
|
|
|
|
I used some online tool and paste his text over and translate to english. It comes like :
"A student i ss as CDA creation and development of application intranet, extranet and my project of end of study and a blend between discussion forum and site training numriser and courses video upload and download ben if quilqu a little m help if you plez"
|
|
|
|
|
I think this is what JHizzle did if he is not French (his profile says so ).
But still it doesn't make much sense.
..Go Green..
|
|
|
|
|
Nah, my french is pretty good but even so, I only got something about a final year project for his course and pretty much turned off after that.
|
|
|
|
|
Yeah of course. txtspeak in French
I thought it's only English that got affected.
..Go Green..
|
|
|
|
|
Hi all,
In my project, Parent page opens a child page using window.open method on a button click.
Child page has a method LoadDropDownList() in page_load, which is supposed to populate a drop down list in the page. LoadDropDownList method creates an object of a class from the referenced library and calls a method on that object which performs some heavy operation to get strings and populate the dropdownlist. This takes around 3-4 seconds. I release the object in the finally{} block in this method.
Now, Even if my child page is closed using (X button) immediately after its opened (before 3 seconds), the loaddropdownlist method is already initiated.
After that I open the child and close it immediately for 3-4 times aproximately and then the next time parent page is unable to open child page . IE 7 just shows running status. Probably Server experiences some heavy load due to multiple LoadDropDownList ongoing runs in the stack.
Is memory leak is happening here?
Shouldn't it stop running child's LoadDropDownList() and get read of the objects immediately after I close the form? But it's not happening. I found control returns to this method multiple times after i (opened for number of times and) closed the form respectively.
What is the remedy here? How child should stop running any method in it after it's closed?
Kind regards,
Vijay
|
|
|
|
|
Closing the browser does not tell the server anything. So the server still does all the processing initiated by the request as if nothing happened. It is not a memory leak from the browser point of view. But if only 3-4 calls to this process of yours are enough to slow down the server you really need to evaluate that method and figure out how to optimize it.
|
|
|
|