|
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.
In case of normal page ( without Masterpage), it works fine. Can anyone help me in this? Thanks in advance.
Regards,
Jay
|
|
|
|
|
Because the Label is placed in the Content control, that also means it is later put in the ContentPlaceHolder control which is a naming container. So you need to get reference to this control fist before accessing the Label control.
|
|
|
|
|
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.
-- modified at 0:05 Saturday 19th August, 2006
-- modified at 0:06 Saturday 19th August, 2006
Regards,
Jay
|
|
|
|
|
hi,
Is it possible to bind the datagrid with the database table rows as columns. In ASP.NET2.0 there is a control called "Details view". i need exactly the same style in ASP.NET1.1.
That is i want the table headers to be in the first column and the row in the next column.
I will the data by a sql statement with select statement.
eg: select ssn,fname,lname where ssn = 1234
|
|
|
|
|
|
I have a vb.net web page with a dropdownlist - the page displays a customer record. The options in the dropdownlist are hard-coded.
I'd like to have the dropdownlist show the value saved in the database when the user pulls up a customer record.
However, when I bind the control to the dataset (default view 0) the dropdownlist displays the value from the database on several lines eg:
o
p
e
n
instead of "open" on one line.
Should I be setting the value of the dropdownlist a different way other than using the databinding ?
Thanks
|
|
|
|
|
Can you show your code here, it would be helpful to reply.
thanks
Naveed Kamboh
|
|
|
|
|
I'm using vb.net. I used the databinding 'wizard' to set the source (eg I click on the control then click on the elipse button in the databinding property)
After selecting the column from the default view, visual studio sets the datasource as - DataBinder.Eval(Dscustomerdetails1, "Tables[customers].DefaultView.[0].type")
|
|
|
|
|
|
Hello Friend,
I am using a treeview and populating it from web.sitemap.
On the basis of text vlaue I want to hide some nodes for the users.
I am not finding how to hide the nodes.
can any one help me please.
thanks
Naveed Kamboh
|
|
|
|
|
Hi,
I'm not sure if this is what you are looking for but here goes.
Tree Looks like this
Tree Node 1
Tree Node 1 a
Tree Node 1 b
Tree Node 1b i
Tree Node 1b ii
Tree Node 1 c
Lets say you want to hide Tree Node 1b ii
TreeView.DataSource = SiteMapDataSource1;
TreeView.DataBind();
TreeView.Nodes[0].ChildNodes[1].ChildNodes.RemoveAt(1); //This hides tree node 1b ii
Hope this helps.
Remember in order to do this you have to programatically bind the TreeView. Note remove the DataSourceID from the IDE first.
Good luck
Cheers
Disgyza
Programmer Analyst
|
|
|
|
|
thank you very much dear, it worked.
I am happy.
Naveed Kamboh
|
|
|
|
|
i want a popup menu on right click on the datagrid at client side using javascript. please help me.
sam.
|
|
|
|
|
Create a div element and place the datagrid inside it. Then insert the below mentioned javascript(Popup menu script-Dynamicdrive.com) in the head of the page. Call this javascript from div element "oncontextmenu"
<Head>
<script language="javascript">
//DynamicDrive.com
var defaultMenuWidth="150px" //set default menu width.
var linkset=new Array()
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT
linkset[0]='<a href="http://dynamicdrive.com">Dynamic Drive</a>'
linkset[0]+='<hr>' //Optional Separator
linkset[0]+='<a href="http://www.javascriptkit.com">JavaScript Kit</a>'
linkset[0]+='<a href="http://www.codingforums.com">Coding Forums</a>'
linkset[0]+='<a href="http://www.cssdrive.com">CSS Drive</a>'
linkset[0]+='<a href="http://freewarejava.com">Freewarejava</a>'
linkset[1]='<a href="http://msnbc.com">MSNBC</a>'
linkset[1]+='<a href="http://cnn.com">CNN</a>'
linkset[1]+='<a href="http://news.bbc.co.uk">BBC News</a>'
linkset[1]+='<a href="http://www.washingtonpost.com">Washington Post</a>'
////No need to edit beyond here
var ie5=document.all && !window.opera
var ns6=document.getElementById
if (ie5||ns6)
document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')
function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}
function showmenu(e, which, optWidth){
if (!document.all&&!document.getElementById)
return
clearhidemenu()
menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
menuobj.innerHTML=which
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
menuobj.contentwidth=menuobj.offsetWidth
menuobj.contentheight=menuobj.offsetHeight
eventX=ie5? event.clientX : e.clientX
eventY=ie5? event.clientY : e.clientY
//Find out how close the mouse is to the corner of the window
var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
else
menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
menuobj.style.visibility="visible"
return false
}
function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
function hidemenu(){
if (window.menuobj)
menuobj.style.visibility="hidden"
}
function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}
function delayhidemenu(){
delayhide=setTimeout("hidemenu()",500)
}
function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}
if (ie5||ns6)
document.onclick=hidemenu
</script>
<body>
<div oncontextmenu="showmenu(event,linkset[0]);return false;"><asp:datagrid id="DataGrid1"></asp:datagrid></div>
</body>
</Head>
Raghu
|
|
|
|
|
HI ,,,I ahve some div tags wiht content editable=false in a page...when i delete a div by keeping a cursor in front of div tag i want to know which div tag si going to be deleted...i can use any events inside div tag b'cos all div tags are going to be in a IFrame....
|
|
|
|
|
Please don't cross post.
---
What do you mean? Where is it that you delete the div tag? In the browser? In page source? In the design view?
-- modified at 7:41 Friday 18th August, 2006
---
b { font-weight: normal; }
|
|
|
|
|
Hello! I trying programming in WEB (ASP.NET) and have small (but BIG for me problem.
In my ASp NET page I have button which send to server some ID. The server forms locally file and then must post to client file. How client can download file from server?
Thanks!
(Forgive me for my bad eglish
qqq
|
|
|
|
|
|
Very thanks!
Bast regards, vanolviv
qqq
|
|
|
|
|
always welcome..
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi,
I need help to convert a excel spreadsheet to a mdb file(access database). Any idea on where I can find help on this, and read more on it.
It have to use the VB.net with my code. I know how to reads two 'sheets', and then insert that info into a database.
I know how to get the information from excel using a SELECT query and System.Data.OleDb.OleDbConnection, and OleDbDataReader. Problem is taking this information and inserting it into the access database.
Any help or suggestions?
|
|
|
|
|
When I click save button i am calling a function to RegisterClientScriptBlock
Page.RegisterClientScriptBlock("keyClientBlock",jScript);
How should i disable this...I cant remove this function bcoz i have one page inside another page...
Regards,
Sivaprasad
|
|
|
|
|
If you are re-posting a form by reloading the page, the browser sends up this warning. This is a security precausion, so that the user won't re-post data without being aware of it.
The warning might be able to disable manually in the browser, but not by using script.
---
b { font-weight: normal; }
|
|
|
|
|
hi,
i am having an appliction with one MultiLine text box and one lable.
if i selected on sentence in multi line text box it should diply on lable. using java script .
kamalnath
|
|
|
|
|
im trying to return a string value from a windowDialog.
not having much luck, ive got this closeDialog() funtion that i set the return value (retVal) from the value of a Label. the label have a Text value init ("55188") but my dialog continually return null
anm i doing somthing stupidly wrong, any help would be apreciated.
CODE:
<code><TD style="WIDTH: 127px; HEIGHT: 27px"><asp:label id="lbCustID" runat="server"></asp:label></TD>
function closeDialog()
{
var retVal = document.getElementById('lbCustID').getAttribute("Text");
window.returnValue = retVal;
//document.write(retVal); - for debug
window.close();
}
</code>
Thanks.
-- modified at 7:02 Friday 18th August, 2006
|
|
|
|