|
well, what is the error message you're getting ? That might help....
Is this an Access db? I can't remember, it's been so long since I used Access, but don't you have to say "delete * from..." in Access, not just "delete from..." ? I could be wrong on that...
|
|
|
|
|
This is ASP code, as you said. This is the ASP.NET forum, the Web Dev forum is a better place to ask this.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
What does request.QueryString("ProductID") come in as - is it a string?
|
|
|
|
|
I have created a web user control with a drop down for "Main Categories" in it and a place holder.
<asp:UpdatePanel ID="pnlcategories" runat="Server">
<ContentTemplate>
<asp:DropDownList runat="Server" ID="ddlCategory" AutoPostBack="true" OnSelectedIndexChanged="ddlCategory_SelectedIndexChanged"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="pnlsubcategories" UpdateMode="Always" runat="Server">
<ContentTemplate>
<asp:PlaceHolder runat="server" ID="plhCategories" EnableViewState="true"></asp:PlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
In the page load, i am populating the main categories drop down.protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
populateCategoryField();
}
On the selectedindexchanged event of this drop down, i have created another drop down for "Sub-Categories" dynamically and added it in the place holder.I have assigned the SelectedIndexChanged event for sub categories drop down like this,
DropDownList ddlSubCategory = new DropDownList();
ddlSubCategory.AutoPostBack = true;
ddlSubCategory.SelectedIndexChanged += new EventHandler(this.subCategories_SelectedIndexChanged);
plhCategories.Controls.Add(ddlSubCategory);
and in this method, another sub categories drop down is created.
Now when i change the selection of sub category, it is supposed to create another sub-sub-category drop down but nothing happens.
Plz anyone tell me y isnt it working?
|
|
|
|
|
Dynamically created controls need to be created BEFORE page load, in order that they are in existence when the viewstate is populated ( just before page load ). Otherwise, their state is not restored, nor will their events fire.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
In my website I have used cache. In my load event of the page I check the cache .If it is null I fill a DataTable object from the database and assign that table to the cache. And then in my code I use the cache to fill the controls. Now my problem is this " sometimes I get the "Object reference not set to an instance of an object(NullReferenceException)" error. I am sure that this error is related to cache. Why this error happens sometimes only and not always . what is its cause ? Can someone help me ??
|
|
|
|
|
No one can help you without seeing your code...So if possible please post sample code...
|
|
|
|
|
Things to not stay in the Cache forever. Even if you don't have a timeout set for your cache if the system needs more memory it will expire something in the cache. It is a good coding practice whenever you use something from the cache to first check to make sure it is not null or Nothing in vb.net before you use it. If it is null or Nothing then you need to call the code again to populate the cache.
Hope that helps.
Ben
|
|
|
|
|
kubben wrote: If it is null or Nothing then you need to call the code again to populate the cache.
I have done this but I see this error sometimes.
|
|
|
|
|
Are you sure every place you use the cache object you are checking for null or nothing before you use it? It seems like you either missed a place or the only other thing I can think of is the stuff you are putting into the cache is so large that it gets kicked out of the cache pretty quickly.
Ben
|
|
|
|
|
Hello All!
plz help me that how can i add the user control dynamically on a page by/after clicking a button
if i write the code in button1_click method then it shows only once and not adding after every click of the button.
UserControl uc1 = (UserControl)LoadControl("WebUserControl1.ascx");
Page.Controls.Add(uc1);
Please give me answer quickly.
Best Regards,
Mairy
|
|
|
|
|
to add user control dynamically in a page, there must be a container for the control. Either a panel or place-holder web server control can act as a container for the user control.
WebUserControl1 uc =
(WebUserControl1) Page.LoadControl("WebUserControl1.ascx");
PlaceHolder1.Controls.Add(uc);
Regards
John
|
|
|
|
|
also, it needs to be added before page load if you want it to have viewstate ( including events )
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I use a RegularExpressionValidator control and a RequiredFieldValidator control to validate the FileUpload control's filepath, but when I click the button to submit, the page still shows the RegularExpressionValidator's ErrorMessage which should not be shown. Why? If anyone knows, please do me a favor.
|
|
|
|
|
It is hard to say without seeing your code. I am not the best at regular Expressions, but it would be my guess you have an error in your regular expression.
Ben
|
|
|
|
|
Don't use any inBuilt Validator for validation just use
Javascript and get the path by this way
fileUpload1.postedFile.path
check if the path is NULL or Wrong
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Thanks for your advice. I have removed the RegularExpressionValidator and replaced it with a CustomValidator. With some JavaScript, now the program can validate the input on the client-side.
Best regards
|
|
|
|
|
Hi, I don't know if this is the correct forum for my question, but I really need your help. I get the exception "Cannot access the Web server because Microsoft Internet Explorer is offline. Run Internet Explorer, uncheck the File menu's 'Work Offline' Item, and retry" , when I try to open my project in Visual Studio 2003. This has never happened before, and I thought you didn't have to be connected to the internet to open up your project in Visual Studio? What's going on, why am I getting this error message? I cannot open any of my projects, everytime I try, I would get that same exception. I did a search on the exception but nothing on the topic was found. thank you in advance for your help.
|
|
|
|
|
Hello,
VS 2005 + SQL 2005
This works:
<br />
connectionString="server = steve01\sqlexpress; database = servicemasterTEST; user id = sa; pwd="<br />
This does not:
<br />
connectionString="server = steve01\sqlexpress; database = servicemasterTEST; trusted_connection = yes"<br />
This also doesn't work:
<br />
connectionString="server = steve01\sqlexpress; database = servicemasterTEST; integrated security = true"<br />
The connection string is located in the web.config file as tihs is a connection string for a web service.
I have been to www.connectionstrings.com and looked and tried them as well.
I can't userstand why it would let me use the user name and password but not the windows authenication.
I have started sql server management studio and entered for both sql authenication and also for windows authentication. Both of them work in sql server management studio.
I have check sql server to see if it running, and also set it for local and remote.
Can anyone tell me if I am missing something simple here.
Many thanks,
Steve
|
|
|
|
|
I have a web page that works fine locally, but gives errors when viewing off the server.
It's the "I have an error, but you must turn the customErrors mode="Off" message.
So I change that, to no effect.
Somewhere I stumble upon a forum post that suggests removing everything but that line.
<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" />
<authentication mode="Windows" />
</system.web>
</configuration>
I tried that and <u>that</u> message goes away, giving a different one.
Studio has generated this steaming pile, shouldn't it be correct?
My problem is this: what about the rest of my web.config lines, such as the database connections?
I even created a brand new web application, to see if I had somehow messed up the first one.
Same error again.
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
Are you sure you need
authentication mode="Windows"
for your app? Try setting it to "none" otherwise...
|
|
|
|
|
I tried changing that. Didn't work.
With the current cut-down web.config file (no namespaces, configuration, etc),
<configuration>
<system.web>
<customErrors mode ="Off"/>
<compilation debug="true" strict="false" explicit="true" />
<authentication mode="Windows" /> ' or mode="none"
</system.web>
</configuration>
I get this now:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'WebApplication2._Default'.
Source Error:
Line 1: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebApplication2._Default" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The project has been Built and Published.
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
well the error mesage would imply that it can't find the compiled code-behind - can you ftp to your site an check whether the WebApplication2.dll has been uploaded to the application's bin/ folder..?
|
|
|
|
|
I see the WebApplication2.dll, .pdb, and .xml files in the /bin folder.
The app folder has Default.aspx, WebApplication2.vbproj, WebApplication2.vbproj.user, and web.config.
I checked folder security and Everyone has read access.
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
well I'm sorry buut I don't know... don;'t know either what the .vbproj and .vbproj.user are doing there - they are unnecessary, as is the .pdb file in bin/
I am a little surprised there is no global.asax file in the root folder, but don't think that would cause this... might be worth a try though...
I presume the first line of your Default.vb file is:
Public Class _Default
If not, therein lies the error...
Otherwise, I am puzzled. Have you re-inststed your web.config to it's full glory?
|
|
|
|