|
Thanks for the response. However, I came across another article in the meantime that indicated it's along the same lines, but not quite the same.
It turned out the reason was simply that I was not assigning the "Value" field. In my particular instance, I have no use for the value field. I guess if you statically declare menu items, ASP assigns the value field behind the scenes if you do not explicitly declare a value. And apparently the value can be almost anything. I just assigned .Value = Guid.NewGuid() (or whatever the method is, I don't remember right now), and everything works just fine.
The moral of the story: ALWAYS POPULATE THE VALUE FIELD OF DYNAMIC MENU ITEMS!
|
|
|
|
|
Hi!
I have a login control (LogIn.asmx) and a search control (Search.asmx). When typing in the search control and pressing return the whole page is posted to the server. My login control is looking for IsPost back but still it tries to log me in?!
How should I do to prevent this behaviour? How can I make the page respond to the "correct" submitevent?
Thnx!
|
|
|
|
|
As far as I can understand, you have two usercontrols inside a server side form. so when you are pressing enter into search control, the postback fires and hence gives problem to your login control.
The solution is that you keep the two controls in two different forms in the page. Since there can't be two server side forms, so one of your forms have to be an ordinary html form, and you have to deal with that usercontrol in the classic ASP style.
Thanks
Pradipta Basu
|
|
|
|
|
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.
|
|
|
|