|
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
|
|
|
|
|
Store the words as text along with the sound data, so that you can search that.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
Here's some code to get you started:
CREATE TABLE MyMp3s<br />
(<br />
Mp3Image image<br />
)<br />
GO<br />
<br />
CREATE PROC InsertMp3Image<br />
@Mp3Image image<br />
AS<br />
INSERT INTO MyMp3s VALUES(@Mp3Image)<br />
GO<br />
<br />
<br />
Int32 m_MaxFileSize = 10240000;<br />
<br />
SqlCommand storedProcedure =<br />
new SqlCommand("InsertMp3Image" , SqlConnection);<br />
storedProcedure.CommandTimeout = 30;<br />
storedProcedure.CommandType = CommandType.StoredProcedure;<br />
<br />
System.IO.BinaryReader binaryReader =<br />
new BinaryReader(<br />
new FileStream (@"C:\Mp3\MyMp3.mp3",<br />
FileMode.Open,<br />
FileAccess.Read));<br />
<br />
byte[] buffer = binaryReader.ReadBytes(m_MaxFileSize);<br />
<br />
binaryReader.Close();<br />
<br />
storedProcedure.Parameters.Add( "@Mp3Image", buffer );<br />
<br />
storedProcedure.ExecuteNonQuery();
I copied it from -
http://www.thescripts.com/forum/thread80344.html[^]
suri83 wrote: When we enter a word and do a search on that, we should get all the sound files containing that word.
As the other person told just store some unique information relating to the sound files in the database and search the db for this unique key!
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
After converting my first ASP.NET 1.1 project to 2.0, I discovered that one of my button's onclick handler wasn't working. I then proceeded to inspect the InitializeComponent code to find that it was empty. Also there was no declartion of the button control -- or any other control present. Where does ASP.NET v2.0 put this code? Also, is there any way of fixing my problem in code or do I have to delete the button and re-create it so that ASP.NET v2.0 can do it's "under the hood" stuff right?
JSaybrook
|
|
|
|
|
The reason this works has to do with the partial keyword applied to your codebehind class. In addition to turning your .aspx file into a class definition with methods for rendering the page, as it has always done, ASP.NET now also generates a sibling partial class for your codebehind class that contains protected control member variable declarations. Your class is then compiled together with this generated class definition and used as the base class for the class generated for the .aspx file. The end result is that you essentially write codebehind classes the way you always have, but you no longer have to declare (or let the designer declare for you) member variable declarations of server-side controls.
|
|
|
|
|
My basic problem is that one of my buttons, that used to work in the 1.1 version no longer works after the application was converted to 2.0. By that I mean that that the OnClick event doesn't fire. In 1.1 the probable culprit would be a missing "wireup" in InitializeComponent. Now the only reference to the button control that I control appears to be the one in the "html" in the aspx page. Would it help to delete this reference and re-create it? According to what you say it wouldn't appear to matter whether I used an editor or the designer to do this.
jsaybrook
|
|
|
|
|
Are you using the CodeFile keyword in your @Page directive?
What about runat="server" in the button? (Just making sure)
|
|
|
|
|
How do I go about letting my client adjust which columns they do and do not want to see in a gridview? I would like to have a separate page that holds all of the columns in the database and they can check or uncheck the ones they want.
GaryT
|
|
|
|
|
One way I've done this is by using code to construct the SQL SELECT statement (using only checked columns), then binding that to a gridView with AutoGenerateColumns set to true .
|
|
|
|