|
Hi...
I have created one class file XYX.cs under app_code directory...
and One usercontrol ABC.ascx file under usercontrol directory....
Now i want to get object of ABC.ascx file in XYX.cs file....
here both file namespace are similar...
But my problem is i cannot get object of that .ascx file in .cs file..
If i put that usercontrol file in .cs file than i am getting object...
but i dont want to put that user control in app_code....directory...
Is there any Solution for this....
?
?
?
Please help me...
Thankyou
Hemant Patel
|
|
|
|
|
Hi All,
I've exclusivly opened Mdb file. If I access in appln, I'm getting error such File is in use. By closing that, I can access that file. I want to check whether it is opened exclusively or not. Can u plz tell me how to check? Tnx in adv.
Balasubramanian K.
|
|
|
|
|
Try it with DSN.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Tnx for ur reply. I'm not clear abt DSN. Can u plz explain.
Balasubramanian K.
|
|
|
|
|
have you checked the Database source name is connected with the connection string and try it using the try catch and catch the exception.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Without the way of error, I want to check the file is opened or not.
Balasubramanian K.
|
|
|
|
|
Use Simply Try - Catch Block if Exception occured then give the message.
|
|
|
|
|
By error only, we r saying the msg.
I need to check like How we r checking the conn string. is opened or not. As well as, I need to check the mdb file is opened or not, If it is opened, I have to throw msg to say close it..
Balasubramanian K.
|
|
|
|
|
BalasubramanianK wrote: I need to check like How we r checking the conn string. is opened or not
I think ther is a propery with Connetion Class
Try to Check with that
Coon is your Connection
Conn.Status
it will give you the result !!!! Please check it and let me know.
BalasubramanianK wrote: , I need to check the mdb file is opened or not, If it is opened, I have to throw msg to say close it..
If the mdf file is open , it should throw the exception isnt it!!!
now
try
{
//Try to open connection
//If file is open then it should throw the exception
}
catch
{
//Handeld Exception
}
|
|
|
|
|
Tnx Mr. Jana..If there any other way, just u tell me.
Balasubramanian K.
|
|
|
|
|
try<br />
{<br />
}<br />
Catch<br />
{<br />
}
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you then save my time by voting my post.
|
|
|
|
|
Actually, I need to check the mdb file is opened or not. I dont want to throw msg, if error exists. If file is opened I want to say to close the file...Tnx for ur reply
Balasubramanian K.
|
|
|
|
|
Open the file for exclusive access and catch the exception if it fails:
<br />
File.Open(Path, FileMode.Open, FileAccess.ReadWrite, FileShare.None)
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you then save my time by voting my post.
|
|
|
|
|
Is there anything like connection state?
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
|
ok thank you
Balasubramanian K.
|
|
|
|
|
any one please help me
I have the following code for Emailing .
My doubt is I am able to send mail only to gmail(as a spam) but not to other mail like yahoo(not even as a spam) etc. What could be the reason .I have even configured web.config file and ....Relay->127.0.0.1
kindly help me
Thanks in advance
---------->
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress(txtFrom .Text.Trim ());
mail.To.Add(txtTo.Text.Trim ());
//set the content
mail.Subject = txtSubject .Text ;
//first we create the Plain Text part
AlternateView plainView = AlternateView.CreateAlternateViewFromString("Some Plain Text" , null, "text/plain");
//then we create the Html part
AlternateView htmlView = AlternateView.CreateAlternateViewFromString("<b>"+txtBody .Text.Trim ()+"</b>", null, "text/html");
mail.AlternateViews.Add(plainView);
mail.AlternateViews.Add(htmlView);
//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1"); //specify the mail server address
try
{
smtp.Send(mail);
Response.Write("Mail Sent...");
txtBody.Text = "";
txtFrom.Text = "";
txtSubject.Text = "";
txtTo.Text = "";
}
catch (Exception ex)
{
Response.Write (ex.ToString ());
}
<---------->Kovuru Sreedhar
|
|
|
|
|
Check to see if your IP Address(external) is blocked, or on a spam list. Also make sure you aren't sending messages with keywords that might tag it as spam.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
what are the possible keywords for spam mail?
Kovuru Sreedhar
|
|
|
|
|
it amy be any exe
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
hi
i m created one component inj windows application i can give the reference in my window application and can add this control in tool box in my windows application only.
but in my web application i can add reference this component dll i can be added. but i can not add this control in tool box .
please share your ideas with me how can i add user created windows component in web application
please help me
with regards,
bretto
|
|
|
|
|
The Page_PreInit() method should be invoked before the Page_Load() is called right ? As per the ASP .NET Page lifecycle PreInit is before Load. However when I try to debug that is not the case. My code in Page_PreInit() never gets called and the execution is passed directly to Page_Load(),
Any suggestions ?
|
|
|
|
|
Make sure it's hooked up right or that auto hookup is turned on and it's spelled right.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I think there is some problem in spelling .Please check it from
protected void Page_PreInit(object sender, EventArgs e)
{
//write your code here
}
Cheers!!
Brij
|
|
|
|
|
can you please show the code of what you doing?
|
|
|
|