|
The problem is, when you press Enter key from the Search control, its triggering Login Control's submit click... This is because Login Control has the Default Action Command.
To solve this problem, use javascript in onkeycode event of each TextBox control in your UserControl and trigger the Submit action when Enter key is pressed.
|
|
|
|
|
Hi
C# / IIS.
I have a user defined control (derived from HtmlInputButton) which registers client side javascript when instantiated. If this control is present when the page is created, the javascript is registered. Nothing impressive there.
but...and ain't there always....
I want to create this control on the fly as part of a partial screen udpate using ajaxy/atlas type methods. The control is created, displayed etc, but the javascript isn't written out. I know why, as the page isn't being redrawn, and only the <div> is affected by some deeply hidden XMlHttpRequest object thingy, but that isn't much use to me.
So, the question is, can I register Javascript after the page is created, and if so, how? I tried creating the button, hiding it until needed, but the button params, and bits of the generated Javascript will only be known at runtime, so this isn't really an option. Any help much appreciated.
Cheers
|
|
|
|
|
The first thought that comes to mind is why not register the script whether the control is on the page or not. Not optimal, and I probably don't understand your situation, but the script would be there when needed, no hassles about how to load it.
only two letters away from being an asset
|
|
|
|
|
I tried that, but the script is created based on other input on the screen. I don't know 'exactly' what the script will be until runtime, ie the user makes a few selections, and then this button appears.
|
|
|
|
|
In this case, you don't use the RegisterStartupScript method to register your dynamic script as it requires a postback. You may consider emitting the script along with the output html markup of your custom control, I mean in your control you can override the RenderXXX methods to emit the dynamic script with the script element to the writer, and as a result the dynamic script is also appended to the document at runtime like the dynamic control.
|
|
|
|
|
Sounds good - I'll give that a try.
Cheers
|
|
|
|
|
Solution (simplified)
<br />
namespace MS_Test{<br />
public class myButton : HtmlInputButton<br />
{<br />
public myButton( string t)<br />
{<br />
Value = t;<br />
Attributes.Add("onclick", "testMe()");<br />
}<br />
<br />
protected override void Render(HtmlTextWriter writer)<br />
{<br />
Page.ClientScript.RegisterStartupScript(this.GetType(), "tt", "function testMe(){alert('tested');}", true);<br />
base.Render(writer);<br />
}<br />
}<br />
}<br />
Regards
Angel
*********************************************
|
|
|
|
|
I've been trying to setup IIS & ASP.NET 2 onto a Windows 2000 SP4 box. The application it's supposed to be running has been written on my XP laptop and works fine but now it has to run on this machine.
IIS was already installed on it (with .NET 1 and 1.1), I installed .NET 2 and copied across the necessary files (tested and it compiles fine with MSBuild on the 2000 machine). When you try and view the page in IE a "Service Unavailable" message is displayed telling you to look at the log. There are three entries, the most pertinent being:
Failed to execute the request because the ASP.NET process identity does not have read permissions to the global assembly cache.
Error: 0x80070005 Access is denied. There is also a warning message just before this one saying that it was unable to load System.Web because access was denied.
I've googled around and checked through all the knowledge base articles about permissions etc to the point where the ASPNET user on the server has full control to the required directories. As do the two other IIS accounts. Also tried aspnet_regiis -i and restarting IIS to no avail.
Does anybody have any ideas, without having to reinstall everything preferably because I have access to the server through VNC (and admin priviledges on it) so if preferable I don't want to reboot as I won't be able to log in again .
|
|
|
|
|
Just a shot, try :
aspnet_regiis -ga domain\processusername
|
|
|
|
|
Nada
|
|
|
|
|
Just thought I'd mention that the error message reported by ASP.NET is complete & utter b*****cks, it couldn't get permission to the application directory, not the GAC.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
Fixed - Permissions on app directory
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
how do i cange the back color of a table cell? I want to backcolor a particular cell
t.aransiola
|
|
|
|
|
TableCell myRedCell = new TableCell();
myRedCell.BackColor = System.Drawing.Color.Red;
or if the cell is already present
myTable.myRows[thisRow].Cells[thisCol].BackColor = System.Drawing.Color.Red;
where thisRow and thisCol are indexes into the table
Regards
Angel
*********************************************
|
|
|
|
|
document.getElementById ('myTDid').style.background-color=#000000
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
where do i put all these codes?
how do i know the cell reference to apply this code
remeber i am using a table to do a page layou. I just want to color some of the cells
t.aransiola
|
|
|
|
|
Are you doing this server side or client side. Post your code so we can see what you have tried already.
|
|
|
|
|
doing server side. i am using table as a layout for my page
t.aransiola
|
|
|
|
|
Hi, I am in a huge confustion on how to communicate from an asp.net (made by vb.net) web site to an application situated on the computer that is made by vb.net as well. My website is a trading website (maltatrade.org) and i need this application to be installed on every member's computer.
This application all it does is to check if there's a new comment for them. How can I make this happen please??
Regards,
Adrian
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Query through a web service maybe?
|
|
|
|
|
ADY007 wrote: situated on the computer
Typically web applications involve two computers, the server and the client where the browser is running, so which "the computer" are you referring to?
led mike
|
|
|
|
|
so yes, the client one.
So, the client installs this application to get notified as soon as a new comment is recieved to him from the website of cource (maltatrade.org). I need to make a communication from the Client to the Server.
How can I make it happen please?? Thanks for your help.
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
What type of communication? pls be explicit
t.aransiola
|
|
|
|
|
ADY007 wrote: I need to make a communication from the Client to the Server.
Well you certainly have not provided a complete picture but it is possible that you simply need to poll your web server using a http request from the client as Paddy suggested using a Web Service would work for this.
led mike
|
|
|
|
|
I heard about web service. But i don't know how to build a web server All I want is just I have a database in the web server and I want the application (client application) to check the database and check if there is any new comment. If yes it returns a boolean true else false.
This type
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|