 |
|
 |
In other words I cannot use the ASP.NET validators. I must write my input validation within my on-click event handlers just like I did in Classic ASP?
|
|
|
|
 |
|
 |
There are a couple of options here that you might consider:
+ You are still able to use the ASP.NET validators, but depending on which button is clicked you need to disable the validator accordingly (set the enabled property to false. The validators in the web page are basically stored in the Page_Validators array at the client side.
+ You provide your own client side functions like you did in the classic ASP.
+ You can implement your own custom validator that basically only runs when a specific button is clicked. You can do a simple checking in the client side validation function.
+ You can use the ASP.NET validators and store them in the seperate arrays, depending on which button is clicked you can get the validators from an array to run.
|
|
|
|
 |
|
 |
I went to Locations and changed the location to my local web site and added ASPNET..and when rum project and recieved no message but controls are not displayed in Internet explorer
|
|
|
|
 |
|
 |
Which controls are not displayed? Do you mean the standard ASP.NET controls? Does this happen to non-Microsoft browsers like FF?
|
|
|
|
 |
|
 |
Hai,
I have used windows color picker (dlghelper object) through javascript function. It is working fine in some server and the same code is not working for some other server.The code is
<OBJECT id="dlgHelper" height="0" width="0" classid="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b"
VIEWASTEXT>
</OBJECT>
<script language="javascript">
function test(objName,objLabel)
{
var sColor=window.document.dlgHelper.ChooseColorDlg();
document.getElementById(objName).value=sColor;
document.getElementById(objLabel).style.backgroundColor=sColor;
return false;
}
But in that server where this color picker is not working all ther javascript functions are working.So I don't think that it is a problem of disabled javascript or popup window. I am very confused, why this is happening.Please help me to find the reason and show me a right way. Thanks much.
Thank You,
Rahul.P.Menon.
SoftwareDeveloper(.NET)
|
|
|
|
 |
|
 |
It is very unlikely that the problem has anything at all to do with the server. The javascript is run entirely in the browser.
The only way there might be a difference depending on the server, is if the security settings in the browser is different for the servers. Still, this is a setting in the browser, and has nothing to do with the server itself.
---
b { font-weight: normal; }
|
|
|
|
 |
|
 |
Hi!
I am having a typical problem ,I am using management classes to get the path for shared folders and files of the system.The code is working fine for console and winforms,but it is not working for web applications.I have tried giving admin rights to aspnet account,but the problem remains there.Please help
ManagementObjectSearcher searcher1=null;
searcher1=new ManagementObjectSearcher("SELECT * FROM Win32_Share");
try
{
foreach(ManagementObject share in searcher1.Get())
{
s=share["Path"].ToString();//for asp.net pages giving null obj ref exception
}
|
|
|
|
 |
|
 |
You might try to impersonate an user who can access the Path property of the ManagementObject instance:
<identity impersonate="true" userName="..." password="..."/>
|
|
|
|
 |
|
 |
Hai
Is there any webserver other than IIS to execute and Develop ASp.NET applications
Thanks and Regards
|
|
|
|
 |
|
 |
Hi there. The Web Matrix[^] and VS 2005 have the built-in web development servers. In addition, you might also want to check out the Cassini[^]
|
|
|
|
 |
|
 |
Thanks for this valuable info
|
|
|
|
 |
|
 |
hello,
i want to override the render method because i want to manually force the form to render itself.how to override the render method.i mean how to write the exact syntax and where?
more dash than cash!!!
|
|
|
|
 |
|
|
 |
|
 |
Private Sub Command6_Click()
Dim I As Integer
Command5_Click()
I = Val(Mid(Text1.Text, 1, 1))
Select Case I = Val(Mid(Text1.Text, 1, 1))
Case I = 1
Text18.Text = Text14.Text
Text19.Text = Text16.Text
Text20.Text = Text13.Text
Text21.Text = Text17.Text
Text22.Text = Text15.Text
'Debug.Print("1")
|
|
|
|
 |
|
|
 |
|
 |
I've followed a number of exmaples, but I seem to always get the following error no matter what I try:
Object reference not set to an instance of an object.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
If anyone could please help, I'd really appreciate it!
ASPX
======================================
<form id="Form1" method="post" runat="server" enctype="multipart/form-data">
<input type="hidden" runat="server" id="fileName" value='<%#DataBinder.Eval(Container.DataItem, "ProjectId")%>_Thumbnail.jpg' />
<input type="file" runat="server" id="fileThumbnail" maxLength="100000000" />
<input type="submit" runat="server" id="fileSubmit" önserverclick="fileSubmit_OnServerClick" />
</form>
======================================
CODEBEHIND C#
======================================
public void fileSubmit_OnServerClick(object sender, System.EventArgs e) {
if (( fileThumbnail.PostedFile != null) && (fileThumbnail.PostedFile.ContentLength > 0)) { {
try {
fileThumbnail.PostedFile.SaveAs(@"C:\Inetpub\wwwroot\clients\projectfiles\file.jpg");
uploadLblMessage.Visible = true;
uploadLblMessage.Text = "Uploaded Successfully";
}
catch(Exception ex) {
uploadLblMessage.Visible = true;
uploadLblMessage.Text = ex.Message;
}
} else {
uploadLblMessage.Text = "Select a file to upload. Please Try Again!";
}
}
======================================
|
|
|
|
 |
|
 |
Hi there,
IMHO, you can quickly and easily figure out which object that you are using is null when you run your sample code in debug mode. Is it the fileThumbnail object? Just a guess.
|
|
|
|
 |
|
 |
It throws the error on this line:
Line 53: public void fileSubmit_OnServerClick(object sender, System.EventArgs e) {
Even thought this object is declared in the page like so:
<input type="file" runat="server" name="fileThumbnail" id="fileThumbnail" maxLength="100000000" />
and the codebehind like so:
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data;
using System.Data.OleDb;
using System.Collections;
namespace OneArch {
public class ProjectList : Page {
protected DataList MyDataList;
public string strClientId;
public HtmlInputFile fileThumbnail;
public HtmlInputButton fileSubmit;
public Label uploadLblMessage;
|
|
|
|
 |
|
 |
jjarman wrote:
It throws the error on this line:
Line 53: public void fileSubmit_OnServerClick(object sender, System.EventArgs e) {
It's just a method declaration. Does the execution get in the body of the method? Where do you declare the label uploadLblMessage? Is it also placed in the web page like the file input element?
|
|
|
|
 |
|
 |
What's the difference between Session_Start and Application_Start inside the global.asx.cs file?
|
|
|
|
 |
|
 |
Hi there.
In a nutshell, the Application_Start event gets fired when the application starts, and the Session_Start event occurs when a new Session is created. In the life of an application, the Application_Start event happens only one time and the Session_Start can be raised multiple times. For more information about this file, you can see Global.asax File[^]
|
|
|
|
 |
|
|
 |
|
 |
Hi everyone, I have class to connect to sql database, this class has some public functions which return datatable, dataset, executeScalar and executeNonQuery.
I am using this class in multiple location/functions in the main page.
If I initialize (new) this class in page load and does not set to nothing it creates the error (refere to subject for error).
And if I initialize it in every function and set it to nothing everytime, it works fine.
Can someone tell me the best way to use it, should I initialize and destroy in every calling function or initialize in page load, use it everywhere and let Finalize() to destroy it automatically... -D
Salim Akbar
|
|
|
|
 |
|
 |
This can be caused by one of two issues;
1 - Your maximum connections have been passed programatically, this is not very common.
2 - The more normal reason is that your close connection + dispose is not being called, this leads to the same sort of error.
IMO the best way to handle this is to keep the scope local and ensure correct handling of errors etc guaraantees that your connection is always closed and disposed of when it is no longer needed and then the connections goes out of scope as your function or sub is released to the garbage collector.
|
|
|
|
 |
|
 |
hi to all
plz help me to solve this problem
i want get excell code from macro in excell and inputing them in asp.net
or vb.net
can i ?
and how can i do ?
TY
|
|
|
|
 |