|
Hello all,
I have a Mster Page contained some control for Search:DropDownList,TextBox,Button
I have another page named Search.aspx
i don't know how i can access the textbox in query:
switch((Master.FindControl("DropDownList1") as DropDownList).SelectedValue)
{
case "Title":
DataList1.DataSource = SqlDataSource1;
break;
.
.
.
}
my sqldatasource1 :select * from table where title=myTextbox.text
but i don't know how i can access to this textbox that placed in master page.
i don't know this work for Searching is true or no,if it's false i be glad for your saying.
Thank you,
Hoda
|
|
|
|
|
The way I'd do it is this:
write a base class for all your pages.
Add a property there that returns your specific Master page class, not the generic class you get from the base page.
To the master page, add a public propery to get the text from the textbox.
FindControl is just nastiness, why go searching when you can specify where it is ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
add this direcvtive in html
]]>
and you can access the master pages text box like
MasterPage pg = new MasterPage();
TextBox tb = (TextBox)pg.FindControl("Text1");
|
|
|
|
|
Can anyone recommend excellent courses, seminars, or training for ASP.net developers?
Our firm has a junior-level developer who has some Java experience and is learning C# and ASP.net on the job. But we'd like to make sure she learns smart practices and not just the standard Microsoft Kool-aid.
Who are the best companies providing courses & training?
Any recommendations would be VERY much appreciated!
-Al Mann
|
|
|
|
|
Hi,
I have seen many websites where pages are created runtime , for example if I create post a property in in property site then what i have given in property name , that aspx page is created according to that page at runtime.
How can i create pages at runtime.
and Is there any pitfalls in creating pages at runtime.
modified on Wednesday, May 14, 2008 12:34 PM
|
|
|
|
|
You need to use URL rewriting to do this.
Don't you just hate coming up with something to put here?
|
|
|
|
|
|
|
Three forums.
Does it matter what I write here? Someone just has to say something about it.
|
|
|
|
|
hai all,
How to create PDF files from Database in .NET??Is there any free component available for this?? Thanks in advance!!!!
with Regards,
Imthiyas Ahamed.A
|
|
|
|
|
Imthu wrote: Is there any free component available for this??
I don't know but there is a free component[^] available for researching it
led mike
|
|
|
|
|
hi friends..
i used the following code to disable the browser back button.
but its not working, until i clicked any button.
Code i used :
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(DateTime.Now.AddDays(-1))
Response.Cache.SetAllowResponseInBrowserHistory(False)
Thanks in advance..
cheers..
|
|
|
|
|
This won't kill the back button, it will just force the page to reload when you go back.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am working with asp.net 1.1. In my web page , dynamically adding one serverTemplate in grid. and the gridbind also calling in the dropdown list SelectedIndexChanged event. sometimes I got an error in the dropdowlist_electedIndexChanged event, that mentioned below. plz help to fix this error
Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.
Thanks..
|
|
|
|
|
This means you're dynamically adding controls and they are not the same when your page refreshes
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How do you make the browser's title bar blink. I want to use this kind of a feature for a simple chat application is asp.net ajax. This functionality is the same as that of gmail chat. Does any one have any idea?
|
|
|
|
|
Anytime a page refreshes and the window is not in focus, the title bar will blink in the taskbar.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Does not quite seem to work. I want to mimic that functionality in my own implementation of a chat application.
|
|
|
|
|
I have tried a callback method in asp.net 2.0 with the help of following
Serverside code
---------------------
sOK = this.ClientScript.GetCallbackEventReference(this, "message", "ShowServerTime", "context", "OnError", true );
-------------------
void ICallbackEventHandler.RaiseCallbackEvent(string eventArgument)
{
//some internal proces
}
--------------------------------
string ICallbackEventHandler.GetCallbackResult()
{
return "OK"
}
-----------------------
Clientside Code
function fnTest()
{
if(confirm("Are u sure?"))
{
<%=sOK%>;
}
}
function ShowServerTime(timeMessage, context)
{
alert(timeMessage);
}
function OnError()
{
alert('An unhandled exception has occurred:\n');
}
----------------------------------
my problem is client side method ShowServerTime does not called
if any one known about this help me
thanks in advance
Known is a drop , Unknown is an Ocean
|
|
|
|
|
I have big problem with this error ..
my site is Ok in my local PC but when i upload the site i see this error in the some page that use ../images in the src of images and when i remove the ../ the problem is solved
how can i solve it ????
with thanks
|
|
|
|
|
try using
~/
instead of ../
|
|
|
|
|
ok but i can't use ~ in my HTML code ( my master Page ) in the src of my tags
|
|
|
|
|
|
MHASSANF wrote: when i remove the ../ the problem is solved
how can i solve it ????
If you solved it, why do you need to ask how to solve it?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
from a popup window?
In my page1.aspx i have a session variable.
and in this page when the user clicks a button i popup a new page called page.aspx
i can't access the session variable in this popup, why?
|
|
|
|