|
suppose I have two pages in my project:a master page and a content page; In the master page I have one textbox(named SearchTextBox) and on ImageButton(named SearchImageButton). And in the content page I have a textbox(named NameTextBox) and one Button(named LoginButton);
Problem description: In the content page, if I have finished input some words in the NameTextBox and press "Enter" key, the SearchImageButton will be fired and executed, not the LoginButton! This was not what I want.
My question is: How can I fired the LoginButton when I finished input words in the NameTextBox and press "Enter", not the SearchImageButton(I can only modify the master page)?
|
|
|
|
|
|
Thank you for your answer!
I'v tried the example you provide. But it not suitable for my project. Maybe you doesn't understand my question.
My situation is between two pages, one is master page and the other is content page. We want to fire the button on content page when we press "Enter".
|
|
|
|
|
That was not exact code you required, you need to put your logic there
You are not having 2 pages, At the end master Page is like control in the content Page, you need to use java script for that just google it.
|
|
|
|
|
Thank you for your answer!
I will try to refer the logic you provide. But I can only modify the master page(because we have many content pages so...)
|
|
|
|
|
I think there is some confusion at your side ...
are you new to ASP.NET ?
if you are using Master Page in the application then there must be many content pages in the application.
TOALPCWJ wrote: But I can only modify the master page(because we have many content pages so...)
This is confusing statement from your side
Just modify the Content Page also is there any issue into that ?
Please let me know
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Yes, I'm a freshmen to ASP.NET.
I mean our project only have one master page. Because our project also contains a lot of content pages, so if I can just modify master page to achieve my result rather than modify so many content pages, that will save a lot of work and much better.
Thank you for your concern!
Thanks!
|
|
|
|
|
Hi,
During the launching of my web app in debug mode I have "one million" of System.TypeLoadException in system.web.dll and System.ArgumentException in mscorlib.dll ?!!
It is a web application hosted by IIS7 on Vista 32 bit.
If I stop the debugging, it works outside VS 2008.
If I call the first page on my site outside VS, I can launch my app in debug mode from VS and it works.
If I do a modification in my code during the debugging (even an aspx file) it takes many time to reload the page (again the system.typeloadexception many many many times...)
How can it possible ?
And How can I catch the error ? Call stack ?
Is it some errors from my code or a configuration problem ?
Thanks in advance,
Yannis.
|
|
|
|
|
On a Web page that accesses a SQL database, I get the following error in IE7 when I click on the paging numbers.
"Microsoft JScript runtime error: 'theForm.__SCROLLPOSITIONX' is null or not an object"
In WebResource1.axd, the execution stops on the scrollpositionx line below:
function WebForm_SaveScrollPositionOnSubmit() {
theForm.__SCROLLPOSITIONX.value = WebForm_GetScrollX();
theForm.__SCROLLPOSITIONY.value = WebForm_GetScrollY();
if ((typeof(this.oldOnSubmit) != "undefined") && (this.oldOnSubmit != null)) {
return this.oldOnSubmit();
}
return true;
The same page works fine in FireFox 3.0.3. I have seen others on the net that have encountered the same problem, but I have found no resolution.
Any suggestions?
Sincerely,
Stephen M. Golden
forsmg-codeproject@yahoo.com
|
|
|
|
|
I think WebResource1.axd contains some JavaScript functions that are not compatible with IE7. Can you debug the JavaScript?
|
|
|
|
|
i used similar code by Neil Meredith.
dynamically i add four user cntrls. when i delete the first i run into trouble(cant delete a second cntrl etc). however there is no problem with the rest.
]]>
]]>
<title>Untitled Page
Destination | Delete | | <asp:placeholder id="ph1" runat="server" xmlns:asp="#unknown">
|
<asp:literal id="ltlRemoved" runat="server" xmlns:asp="#unknown">
<asp:literal id="ltlCount" visible="false" text="0" runat="server" xmlns:asp="#unknown">
<asp:literal id="ltlValues" runat="server" xmlns:asp="#unknown">
public partial class SmplAuditInv : System.Web.UI.UserControl
{
public delegate void DeleteDl(object s, EventArgs e);
public DeleteDl del;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
del(sender, e);
}
}
public partial class SmpAudTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AddAndRemoveDynamicControls();
}
private void AddAndRemoveDynamicControls()
{
// AurecDataAccess ada = new AurecDataAccess();
// DataSet ds = ada.TestAuditInv();
ph1.Controls.Clear();
SmplAuditInv Cntrl = null;
int ControlID = 0;
while (InDeletedList("uc" + ControlID))
{
ControlID += 1;
}
//foreach (DataRow dr in ds.Tables[0].Rows)
for (int i = 0; i < 4;i++ )
{
if (!InDeletedList("uc" + ControlID))
{
Cntrl = (SmplAuditInv)LoadControl("SmplAuditInv.ascx");
Label lb1 = (Label)Cntrl.FindControl("destLabel");
lb1.Text = "Dest:"+i;
Cntrl.ID = "uc" + ControlID;
Cntrl.del += new SmplAuditInv.DeleteDl(HandleRemoveUserControl);
ph1.Controls.Add(Cntrl);
}
{ ControlID += 1; }
}
}
void HandleRemoveUserControl(object sender, EventArgs e)
{
CheckBox chbx = (CheckBox)sender;
SmplAuditInv Cntrl = (SmplAuditInv)chbx.Parent;
ph1.Controls.Remove(Cntrl);
ltlRemoved.Text += Cntrl.ID + "|";
ltlCount.Text = (Convert.ToInt16(ltlCount.Text) - 1).ToString();
}
public static Control GetPostBackControl()
{
Page page = (HttpContext.Current.Handler as Page);
string ctrlname = ScriptManager.GetCurrent(page).AsyncPostBackSourceElementID;
Control control = page.FindControl(ctrlname);
return control;
}
private bool InDeletedList(string ControlID)
{
char[] delim ={ '|' };
string[] DeletedList = new string[100];
DeletedList = ltlRemoved.Text.Split(delim);
int len = DeletedList.GetLength(0);
for (int i = 0; i < len; i++)
{
if (ControlID.ToLower() == DeletedList[i])
return true;
}
return false;
}
}
]]>
<asp:label id="destLabel" runat="server" font-size="X-Small" text="Label" xmlns:asp="#unknown"> | <asp:checkbox id="CheckBox1" runat="server" autopostback="True" oncheckedchanged="CheckBox1_CheckedChanged" xmlns:asp="#unknown"> |
|
|
|
|
|
You might want to ask Neil.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I have a database script which include my custom tables and asp.net roles and membership structure also and i have to execute it from asp.net, i tried but getting errors, all i did through stream read i saved the whole script in string s and then through executenonquery i m trying to run it but getting page full of errors
System.Data.SqlClient.SqlException: The variable name '@RoleName' has already been declared. Variable names must be unique within a query batch or stored procedure.
The variable name '@RoleMemberName' has already been declared. Variable names must be unique within a query batch or stored procedure.
Plz help
Thanks in advance.
|
|
|
|
|
The error message is self-explanatory. SQL variable names are declared multiple times.
|
|
|
|
|
As the error says, the @RoleMemberName' has been declared more than once. You may well end up with other errors as (for example) you cannot reference a function within your code until the function has been created.
The best bet is to put your sql into query analyser, run it, fix the problems (repeat until clean) and then use that script from your application.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
but i am trying to execute the script in newly created database, i think the problem is in reading the script into string var, normally the same script is working fi9 in sql server. Any idea how should i read the script in asp.net?
Thanks in Advance.
|
|
|
|
|
It is nothing to do with taht, I bet if you take the string you are trying to run, paste it into a query analyser window in a new database and run it you will get exactly the same error. This error is caused by not havng a GO statment between each part, therefore your variable is declared twice. I wouldn't be suprised if other errors crop up when you have fixed this one, for example expect to see errors like 'Create xxx must be the first statemnt in th batch'
dream_liner_7e7 wrote: Any idea how should i read the script in asp.net?
What ou are doing will be OK, asp.net is not teh problem, its your sql!
Bob
Ashfield Consultants Ltd
|
|
|
|
|
U are very right, when reading the script in asp.net i m not including the go statement because even including the environment.newline it is only giving the single space and when go statement and other statement come in same line sql through error.
Thanks alot u r the best.
|
|
|
|
|
Plz tell me how should i read the sql script in asp.net so i dont get go or same variable error and this sql script also include aspnetDB.
Thanks in advance.
|
|
|
|
|
I have already told you how to fix the problem, the error is caused by not havng a GO statment between each part.
dream_liner_7e7 wrote: how should i read the sql script
Wthout knowing what the script consists of how do you expect me to do ths? If it is a single script then you cannot put the go statements in as you do not know where to put them, so you need to do it at the point of concatenating the scripts together.
dream_liner_7e7 wrote: and this sql script also include aspnetD
Don't understand ths bit at all.
I'm afraid you are now on your own - you know the problem, so find a solution.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Thanks a lot Sir. U r the best.
|
|
|
|
|
How many App Domains an ASP.NET Worker Process creates if suppose 10 different users are logged into the web site
|
|
|
|
|
One of the pages in my application is taking a lot longer then another page to load. Is there an easy way to check why this is?
I have a gridview which is populated but that is only two pages long.
Also when I use on row create, any factor I set for a row works apart from the last row in the page. If i put the same code in the row data bound it works on every row.
why is this?
|
|
|
|
|
The slow page, is it making use of the GridView?
If true:
Where is the data from the GridView coming from?
It SQL Server, which version?
Is the data coming from a query, stored procedure, or where?
Is the GridView making use of Paging?
|
|
|
|
|
cyber-drugs wrote: The slow page, is it making use of the GridView?
Yes it is making use of Gridview
cyber-drugs wrote: Where is the data from the GridView coming from?
SQL Server
cyber-drugs wrote: It SQL Server, which version?
2003
cyber-drugs wrote: Is the data coming from a query, stored procedure, or where?
Both, Im also running checks on the rows when the page loads
cyber-drugs wrote: Is the GridView making use of Paging?
yes
|
|
|
|