|
|
thx u it works like a dream haha
|
|
|
|
|
Hi Frends
I wanna call a java function on page load event on my .aspx.cs page and want to pass some values from there....but its not working.....
I am doing like this....
this.Attributes.Add("onload", "setObj('Dinesh','Sharma',550,30)"); not working
actually i need to call this java function on page load so i can use it like
<body 'onload'="setObj('Dinesh','Sharma',550,30)"> but i cant pass the values from my .cs page is there any way to pass the value from .cs page
Dinesh Sharma
-- modified at 3:59 Saturday 19th August, 2006
Dinesh Sharma
|
|
|
|
|
Don't write whole sentences in bold. It serves no purpose other than making it harder to read.
What you are using is not Java at all, it's Javascript.
DineshSharma wrote: this.Attributes.Add("onload", "setObj('Dinesh','Sharma',550,30)"); not working
Standard question #1:
What do you mean by "not working"?
The Page object (that "this" references to) is the page itself, not a control on the page, so you can't add attributes to it. So I assume that the error message is that the object doesn't have any "Attributes" property.
Put an id on the body tag and make it a server tag, so that you can access it from code behind:
<body id="Body" runat="server">
Now you can declare the reference and put the call to the Javascript in the onload event:
protected HtmlGenericControl Body;<br />
<br />
Body.Attributes.Add("onload", "setObj('Dinesh','Sharma',550,30)");
---
b { font-weight: normal; }
|
|
|
|
|
Hi guffa
thanks for your great help.....Now I am able to do this .
Thanks
Dinesh Sharma
|
|
|
|
|
HI,
hw r u all,i have a problem ,i have a website that i made in asp.net and vb.net.in this website i want to uppload image on my websever folder name as "Images",and that images i displayed in my datagrid..locally on my machine its working well,bt no i want to test it on my webserver,tell me how can i athunticate against the username and password that my webserver used to uplaod files,here ist he code that i locally use
Dim f_info As New FileInfo(UploadFile.Value)
If f_info.Extension = ".bmp" Or f_info.Extension = ".gif" Or f_info.Extension = ".jpg" Then
Dim f_name As String = System.IO.Path.GetFileName(UploadFile.Value)
'f_name=f_name.Replace(f_name.Substring(0,f_name.
Dim insert_path As String = "images/" + f_name
Dim save_location As String = Server.MapPath("../images" + "/" + f_name)
'Dim phy_location As String = Request.PhysicalPath
UploadFile.PostedFile.SaveAs(save_location)
Image_SaveToDBURL(insert_path).
tell me how can i uplaod image on the webserver through proper Authentication
kindly help me in this regard
|
|
|
|
|
Until now I'm setting the Control page like this:
<%@ Register TagPrefix="Menu" TagName="Bottom" Src="Bottom.ascx" %>
On the top of the page.
But now I need to set the Src dynamicly.
eg.: <%@ Register TagPrefix="Menu" TagName="Bottom" Src="Session["ID"] + "/Bottom.ascx" %>
Something like this.
Now I know that this is not how to do it, but maybe you can help me?
|
|
|
|
|
Hi,
I am using asp.net 2.0. In this,i am using Cross Page Posting. From the second page, i am trying to reference a control (Label) in the prevoius page using 'PreviousPage' property.
Here, in the first page, that Label control is placed within the <asp:Content> tag. (ie I am using MasterPage's ContentPlaceHolder).
Page.PreviousPage.FindControl("lebelid") method return null.
I am tried with refering the NamingContainer before refering the actual control (Label), which is placed within that NamingContainer. It also gives me the output null.
In my previous page, the Label control present within the tag,
<asp:Content ID="Content5" ContentPlaceHolderID="BodyContent" Runat="Server">
</asp:content>
In my second page (using same masterpage) code behind file, i am refering like this,( in Page_Load event)
ContentPlaceHolder myContent = (ContentPlaceHolder)Page.PreviousPage.FindControl("BodyContent");
Still it returns null.
Can anyone help me in this? Thanks in advance.
Regards,
Jay
|
|
|
|
|
Jay_se wrote: ContentPlaceHolder myContent = (ContentPlaceHolder)Page.PreviousPage.FindControl("BodyContent");
The sample code is updated slightly:
ContentPlaceHolder holder = (ContentPlaceHolder)Page.PreviousPage<code>.Controls[0]</code>.FindControl("BodyContent");
|
|
|
|
|
Dear member,
Thanks for your help. It works fine. But i dont know, what this Controls[0] represents?? Can u pls explain me.
Thanks a lot.
Regards,
Jay
|
|
|
|
|
Jay_se wrote: what this Controls[0] represents??
It represents the MasterPage at runtime which in nature is the user control. If you set the Trace="true" in the first page, the control hierarchy of the trace info will give you some ideas.
|
|
|
|
|
Once again Thank you very much .. I have understood.
Regards,
Jay
|
|
|
|
|
i am megha working on asp.net 2005, i am using the Session.SessionId to create a session value, bt the value of session gets chenge on every page, it not to be maintain same as first page.
how can i maintain the same value on each page up the site will not close?
Megha
megha
|
|
|
|
|
Hi,
try and create session variable.
Session("id")=Session.SessionId
and also check the Session.Timeout property.
hope this works.
Nitin.
|
|
|
|
|
Hi All! i want a context menu on datagrid at client side using javascript. how will this possible?
|
|
|
|
|
Hi Nigam,
In the Datagrid try with this Code.
//set the action to handle the contextmenu
function oncontextmenu(event)
{
event.cancelBubble = true;
event.returnValue = false;
this.action("contextmenu");
}
// assign the event handler to the cell template prototype
Active.Templates.Text.prototype.setEvent("oncontextmenu", oncontextmenu);
// create action handler for the right click context menu
grid.setAction("contextmenu", function(src){ showmenu(event,getMenuHeader()+menu);return false;});
I hope this will works.
Happy Coding
with regards
Satips
|
|
|
|
|
I have use this method (Cross Page Posting in ASP.NET Webpages)
but in the secend page, the previous page can not be recognized while i have used <%@ PreviousPageType VirtualPath="-/Sourcepage.aspx"> in the secend page but when in the code view mode of the secend page I see all of the public properties of the first page ,but i can`t use them in run time & recieved an error by this message: Object refrence not set to an instance of an object
Best Regards
Hussein Madani Ghomi
+98-912-5577-832
|
|
|
|
|
|
hello all,
i have a datagrid,in the footer template textbox,i want to do decimal validation for the textbox,i have a javascript which does decimal validation,but when i call the javascript in the itemcreated property of the data grid and use attributes.add to call javascript ,the js function is not getting fired,its something like this,
<br />
Try<br />
<br />
If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Then<br />
e.Item.Attributes.Add("onblur", " return CheckDecimal(this);")<br />
End If<br />
<br />
Catch ex As Exception<br />
lblmesg.Visible = True<br />
lblmesg.Text = "Error : " & ex.Message<br />
End Try<br />
i even tried one more method
<br />
Dim tempmin As TextBox = CType(e.Item.FindControl("txtmintemp"), TextBox)<br />
tempmin.Attributes.Add("Onblur", "javascript:CheckDecimal(this);")<br />
but the js function is not getting fired,is ther any other method,or what is the error in the above code,
pls anyone help me
Regards
kavitha
-- modified at 1:24 Saturday 19th August, 2006
|
|
|
|
|
Hi,
Why dont you use ItemDataBound event ? You can validate each and every cell in there and that too without help of javascript.
I hope i got your point !
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
hello Any body hav idea abt Ajax.i hav to save the value of the fields in the database using ajax in every 10 sec.
like gmail did.it store the mail into the draft after 15 or 20 sec. it saves the mail into draft.
i have to do the same using ajax.
can anybody help me
thanx
|
|
|
|
|
|
hello thanx for replying me.
when i download the zip of anthem example then its not openning it into the dotnet 2003.
is it done by ajax in this example.
thanx
|
|
|
|
|
hi again;
The zip file is the whole anthem project,after you have unzipped the file you got to open it's .net 2003 solution or project file in .net and then compile the project. From there you end up with a .dll file which you should use in your own project.
You have to import the .dll file as reference and in your toolbox as Anthem Tab.
Now you could use the timer control and solve your problem.
Hope the guide would be helpfull
Hadi
|
|
|
|
|
can any one give me the code for the following process
We have to insert Wave files in to sqlserver and then develop a webpage with a search option.
When we enter a word and do a search on that, we should get all the sound files containing that word.
Thanks in advance,
Suri.
suri
|
|
|
|