473,386 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Info Please

Hi,

I want to display Business exceptions in Messagebox in asp.net.For
that i used MessageBox
API function.But when i tried calling this function from UI,it is not
displaying messagebox.Please let me know what vould be the problem.
Here is the UI where am calling the function:

private void btnCaseSearch_Click(object sender, System.EventArgs e)
{
Case BCase=new Case ();
SearchParams sp=new SearchParams();
sp.FirstName = txtFirstName.Text;
sp.MiddleName = txtMidName.Text ;
sp.LastName = txtLastName.Text;
if(txtToFiledDate.Text.ToString()=="" ||
txtFromFiledDate.Text.ToString()=="" )
{
sp.FiledTo =DateTime.MaxValue;
sp.FiledFrom = DateTime.MinValue ;
}
if( sp.FirstName==null || sp.LastName==null || sp.MiddleName==null
|| sp.FiledFrom==DateTime.MinValue )
{
BCase.Validate(sp);
//BCase.CheckFieldReqs();
}
else
{
DisplayCaseSearchResults();
}

}

Here is the Validate Function in BLL

[DllImport("User32.dll")]
public static extern int MessageBox(int h, string m, string c, int
type);
public override void Validate(SearchParams sp)
{

//Validate fields
//base.Validate ();
if (sp.FirstName == null || sp.LastName == null || sp.MiddleName ==
null || sp.Organization == null || sp.FiledFrom == DateTime.MinValue ||
sp.FiledTo == DateTime.MinValue || sp.DisplayCaseNum == null ||
sp.CaseCatCode == null)
{
//throw new ApplicationException("Please select any of the item");
MessageBox(0,"Please select any of the item","Case Search",0);

}
Please let me know why am not able to show the messagebox.

Thanks,
Vishnu

Nov 6 '06 #1
2 1071
you have to use javascript alert

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
<se****@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
Hi,

I want to display Business exceptions in Messagebox in asp.net.For
that i used MessageBox
API function.But when i tried calling this function from UI,it is not
displaying messagebox.Please let me know what vould be the problem.
Here is the UI where am calling the function:

private void btnCaseSearch_Click(object sender, System.EventArgs e)
{
Case BCase=new Case ();
SearchParams sp=new SearchParams();
sp.FirstName = txtFirstName.Text;
sp.MiddleName = txtMidName.Text ;
sp.LastName = txtLastName.Text;
if(txtToFiledDate.Text.ToString()=="" ||
txtFromFiledDate.Text.ToString()=="" )
{
sp.FiledTo =DateTime.MaxValue;
sp.FiledFrom = DateTime.MinValue ;
}
if( sp.FirstName==null || sp.LastName==null || sp.MiddleName==null
|| sp.FiledFrom==DateTime.MinValue )
{
BCase.Validate(sp);
//BCase.CheckFieldReqs();
}
else
{
DisplayCaseSearchResults();
}

}

Here is the Validate Function in BLL

[DllImport("User32.dll")]
public static extern int MessageBox(int h, string m, string c, int
type);
public override void Validate(SearchParams sp)
{

//Validate fields
//base.Validate ();
if (sp.FirstName == null || sp.LastName == null || sp.MiddleName ==
null || sp.Organization == null || sp.FiledFrom == DateTime.MinValue ||
sp.FiledTo == DateTime.MinValue || sp.DisplayCaseNum == null ||
sp.CaseCatCode == null)
{
//throw new ApplicationException("Please select any of the item");
MessageBox(0,"Please select any of the item","Case Search",0);

}
Please let me know why am not able to show the messagebox.

Thanks,
Vishnu

Nov 6 '06 #2
the messagebox if it worked would appear on the server. but services like
asp.net do not have permission to the desktop, so the messagebox call fails.

-- bruce (sqlwork.com)
<se****@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
Hi,

I want to display Business exceptions in Messagebox in asp.net.For
that i used MessageBox
API function.But when i tried calling this function from UI,it is not
displaying messagebox.Please let me know what vould be the problem.
Here is the UI where am calling the function:

private void btnCaseSearch_Click(object sender, System.EventArgs e)
{
Case BCase=new Case ();
SearchParams sp=new SearchParams();
sp.FirstName = txtFirstName.Text;
sp.MiddleName = txtMidName.Text ;
sp.LastName = txtLastName.Text;
if(txtToFiledDate.Text.ToString()=="" ||
txtFromFiledDate.Text.ToString()=="" )
{
sp.FiledTo =DateTime.MaxValue;
sp.FiledFrom = DateTime.MinValue ;
}
if( sp.FirstName==null || sp.LastName==null || sp.MiddleName==null
|| sp.FiledFrom==DateTime.MinValue )
{
BCase.Validate(sp);
//BCase.CheckFieldReqs();
}
else
{
DisplayCaseSearchResults();
}

}

Here is the Validate Function in BLL

[DllImport("User32.dll")]
public static extern int MessageBox(int h, string m, string c, int
type);
public override void Validate(SearchParams sp)
{

//Validate fields
//base.Validate ();
if (sp.FirstName == null || sp.LastName == null || sp.MiddleName ==
null || sp.Organization == null || sp.FiledFrom == DateTime.MinValue ||
sp.FiledTo == DateTime.MinValue || sp.DisplayCaseNum == null ||
sp.CaseCatCode == null)
{
//throw new ApplicationException("Please select any of the item");
MessageBox(0,"Please select any of the item","Case Search",0);

}
Please let me know why am not able to show the messagebox.

Thanks,
Vishnu

Nov 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kenshin | last post by:
Hey! I have another script where i pull all the information from the database and I want to send it to the person. What they do is they enter in their email, and if the email matches, than it will...
4
by: Chris | last post by:
I'm wondering what is the "best" way to structure a set of info about an item, like a book or a hotel. Eg, let's say you had this info to present for each book in a collection: Title Author...
1
by: GChong | last post by:
Hi, Im looking for some general 'marketing' info on dotnet: how long it has been in use (i.e first release date), how many companies are using it, number of .NET developers in the world,...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
20
by: Tim Reynolds | last post by:
Team, I am developing a web service. In testing in on my enw PC, I am expecting to see exceptions thrown appear on my browser. Instead I am getting an HTTP 500 Internal Server Error page and I am...
11
by: cdkorzen | last post by:
I'm sorry if this is a rehash, but all I see is the same info. Here's my debacle: I CAN get the PATH_INFO to work. With ANYTHING but ASP. Python, Perl, Cmd files... works fine. ASP can't...
1
by: kang jia | last post by:
hi when user entered particulars in signuppage and click" signup" button, i will direct them to do_signup.php. if say the NRIC is dupicate in datebase, i will redirect them back to signup page...
3
by: Ken Fine | last post by:
I would like to be able to move my ASP.NET applications to any of a number of servers without changing code. My apps do a lot of disk I/O and in some cases I might be specifying absoute drive...
4
by: Ken Fine | last post by:
I'm making an administrative interface that lists records in a GridView. For *each* row in the gridview, I would there to be two interface elements in addition to some information associated with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.