|
ok I will explain in detail....
The code on html btn click is (on click = "clearFields('frmMain')")
/* The elements to be cleared can be passed as either:
a) a set of arguments, each is a String containing an element name
or
b) a String containing all element names separated by single space.
You can also use a combination, that is, a set of arguements, each being a String as described in b). This option may seem redundant, but may help readability of the code.
*/
function clearFields(form_)
{
var args = clearFields.arguments;
if(args.length > 1)
{
for(var i=1; i<args.length; i++)
="" {
=""
="" var="" elementidarray="args[i].split('" ');
="" for(var="" k="0;k<elementIDArray.length;k++)
" clearformelement(form_,="" getelementobject("window",="" elementidarray[k],="" form_)="" );
="" }
="" else
="" i="0;" i<window.document.forms[form_].length;="" window.document.forms[form_].elements[i]);
="" }
}=""
function="" elementobject_)
{="" if(="" elementobject_="" !="null" )
="" elementobject_.type="=" 'select-multiple'="" elementobject_.options.length="0;
" else="" 'select-one'="" elementobject_.options.selectedindex="0;
" multiple="" input="" types="" with="" the="" same="" name
="" elementobject_.length=""> 0 )
{
for(var ii=0; ii<elementobject_.length; ii++="" )
="" {
="" use="" recursion="" to="" handle="" overloaded="" length="" attribute
="" clearformelement(form_,="" elementobject_[ii]="" );
="" }
="" else=""
="" {="" putvalue(elementobject_,"");
="" }=""
}=""
the="" above="" code="" is="" working="" fine.
after="" click="" on="" html="" button,="" javascript="" gets="" executed="" and="" after="" this="" i="" clicked="" server="" ctrl="" btn,="" gives="" me="" 'the="" viewstate="" invalid="" for="" page="" might="" be="" corrupted'
can="" somebody="" pls="" reply="" me
=""
="" --="" modified="" at="" 5:53="" wednesday="" 9th="" august,="" 2006="" 7:19=""
<div="" class="ForumSig">Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|
|
I have a content managerment system that builds a large object in the .NET 2.0 master page.
I want this object to be accessible in any user control that may be embedded in the content page.
At the content page level I can refer to me.parent.myobject
At the user control level I can refer to me.parent.parent.myobject.
The problem comes when I have nested user controls.
How can I identify how deep the user controls are nested and what the eventual master page is?
Thanks
|
|
|
|
|
I've never worked with this idea before, but could you loop until you find an item whose parent is null? That should then be your topmost item.
|
|
|
|
|
From the user control, you may access to the Master Page with the simple code Me.Page.Master , so whether the control is nested or not the code is still the same.
|
|
|
|
|
can anybody help me in sending codes from asp.net to prevent concurrent users login more than once using same login name in asp.net
sallirajan
|
|
|
|
|
I don't know the method for this but you can do one thing that whenever somebody log's in you can set some value and again if someone trying to log in with the same credentials then you can have a check for that.
Best Regards,
Apurva Kaushal
|
|
|
|
|
concurrent users with same login name can be prevented in two ways :
Using application variable.
Using db table to keep track of logged in users.
In both cases the logout step of a user has to be captured carefully, using logout event as welll as session end event.
-- modified at 5:00 Wednesday 9th August, 2006
s.a.w.
|
|
|
|
|
Hello All,
I need to know that is it possible to have both asp.net1.1 and asp.net2 working on same IIS same time? If yes then how? Actually i have two web application each supporting different versions of ASP.NET. I want to run them both on same IIS same time. And i am not yet successfull in this.
Any suggestion?
Mubashir
|
|
|
|
|
Check the ASP.NET tab in the Properties windows of each application in the IIS snap-in.
|
|
|
|
|
You can run them on the same IIS, but not in the same application pool. Copy the default application pool to a new application pool, and put 1.1 applications in one pool and 2.0 applications in the other.
---
b { font-weight: normal; }
|
|
|
|
|
Thanx alot, it really helps
Mubashir
|
|
|
|
|
How to put checkbox in datagrid through DataGridColoumnStyle.
|
|
|
|
|
Not sure why your post appears in this forum, but you might want to post in the C# forum or read MSDN to see how to do this.
|
|
|
|
|
use ASP.Net Template column... right click the grid and select edit template column in item template drag drop a checkbox from the toolbox
Some People succeed because they are Destined to, but most people succeed because they are Determined to
|
|
|
|
|
Hi!
I hv to fix the image button & label box into the Datagrid.,
In that imgbtn & lblbox i hv to display dynamic values retrieves frm
DB., I am using c# coding how can we do this one..?
Prabu.T
|
|
|
|
|
You can use template column in datagrid and assign the values dynamically to those controls.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thanks for ur suggestion.,
I did that one., How can we retrieve and display the data to that appropriate image button & label box..?
Prabu.T
|
|
|
|
|
You can use onitemdatabound event for that purpose it executes for each an every row of the datagrid. In that event you just have to find the control and assign the values.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi! Apurva!
I am a newer., Can u give me some sample coding..
How can we using that findcontrol method?
|
|
|
|
|
here is the sample code for itemdatabound event:
public void dg_ItemBound(object sender, DataGridItemEventArgs e)<br />
{<br />
if(e.Item.ItemType==ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem)<br />
{<br />
Label lbl = (Label)e.Item.FindControl("lblName");<br />
lbl.Text = "Apurva";<br />
<br />
<br />
}<br />
<br />
}
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi!
I tried that one., but
The DataGrid Control is not displaying.,
We have to Bind the Datagrid na....
How can we do that one..?
Prabu.T
|
|
|
|
|
For that first you need to get the data from the database and then assign the datasouse property and then bind the datagrid by calling the method databind.
This is the sample code to bind the datagrid:
SqlConnection conn = new SqlConnection("Your connection string");
SqlCommand com = new SqlCommand("Select * from emp", conn);
SqlDataAdapter da = new SqlDataAdapter(com);
DataSet ds = new DataSet();
da.Fill(ds);
DataGrid1.DataSource = ds;
DataGrid1.DataBind();
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi!
Thanks i got datagrid with the Labelbox control it displays what i gave in that control's text ie., if i gave lbl.text="Apurva" it shows this one but i i need the value frm DB..
Prabu.T
|
|
|
|
|
For this you need to fetch the data from the database and then assign.
If you are having the data in the same table which you have bind to the datagrid then with the help of datarowview you can access the data and then can assign the data to the control in ontemdatabound event.
like this:
DataRowView drv = (DataRowView)e.Item.DataItem;
lbl.Text=drv[0].ToString();
-- modified at 4:44 Wednesday 9th August, 2006
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi nice yar.,
I got that one also., but if i add another one control with that one., thats a imagebutton control., i did what u gave for that label box i did kike that only
ImageButton img =(ImageButton)e.Item.FindControl("imgbtnModel");
img.ImageUrl= "E:\rose.jpg";
first for ex: i gave like this but for this also i hv to retrieve the url frm DB., k., i vl do that one used that datarowview., but wat s the error in the above one..?
T.Prabu
|
|
|
|