|
Hi there, I saw different techniques to solve FileUpload-Ajax problem. But nothing works for me.
I got a gridview showing all my products, there is a button to open my AddProduct Panel to Add New products.
If I provide all my product details it saves everything except the file(value in FileUpload) in my DB.
I tried Triggers, but it doesnt make any difference.
sample code:
if (picUpload.HasFile)
{
string strpath = Server.MapPath("../ProductPicture/");
picUpload.SaveAs(strpath + picUpload.FileName);
}
product.Picture = picUpload.FileName; //saves filename in DB
Sample Markup:
<triggers>
<asp:postbacktrigger controlid="btnAdd"/> /* button btnAdd adds form values into DB */
</triggers>
=============
|
|
|
|
|
hi,
File upload control does not work with Update panel since it doesn't support asynchronous postbacks.
It requires full post back to occur.
So use
<triggers>
<asp:postbacktrigger controlid="Button1">
within the UpdatePanel and outside of the ContentTemplate
|
|
|
|
|
I have created Grid view dynamically at run time
Suppose
Doctor 00.15 00.30 00.45 1.00
A
B
C
D
E
now if i click any cell then how can i pop up another form. so that i can save records such as name , age and age will come into the cell.
I can select multiple cells of one rows.
|
|
|
|
|
You can either make the information in the cell linked via an anchor which will call javascript in the href to pop up an ajax modal dialog, or wrap the contents in a span and add the onclick event handler to that.
Should you need to change the contents of the cell on return from the form, use javascript to change the anchor or span innerText property.
10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011
|
|
|
|
|
Dim mmsg As String
Dim mto As String
Dim mfrom As String
Dim msubject As String
mto = TextBox1.Text
mfrom = TextBox2.Text
msubject = TextBox3.Text
mmsg = TextBox4.Text
Try
Dim message As New MailMessage(mfrom, mto, msubject, mmsg)
'Dim mysc As New SmtpClient(msr, mport)
Dim mysc As SmtpClient = New SmtpClient("127.0.0.1")
mysc.Port = "25"
mysc.UseDefaultCredentials = True
mysc.Send(message)
MsgBox("the messgage has been sent to '" + message.To.ToString + "' ", MsgBoxStyle.OkOnly)
Catch ex As FormatException
MsgBox("Format exception:" & ex.Message)
Catch ex As SmtpException
MsgBox("SMTP exception:" & ex.Message)
Catch ex As Exception
MsgBox("General exception:" & ex.Message)
End Try
End Sub
above code dosent put any error but email dose not send ,it stay in
C:\Inetpub\mailroot\Queue ,why so happen. Please hlep me. I tried about couple of week but i could not able to solve it.
Thanks
Dipak
|
|
|
|
|
D.K.C wrote: ,it stay in
C:\Inetpub\mailroot\Queue
Your SMTP server is not running.
|
|
|
|
|
Thanks for Replay.
1)I have checked my domian by telnet om 25, which not throw any error,
its ready for emailing.
2)then any other way to check smpt server , is it working ? or Not.
3) IsRemote domain same as Smart Host ?
please hlelp me.
Thanks again...
|
|
|
|
|
This solution helped me a while back. Not sure what exactly it fixed, but it did work (for me at least):
http://forums.devshed.com/iis-97/mail-stuck-in-queue-folder-iis-smtp-virtual-server-windows-xp-service-361246.html[^]">
|
|
|
|
|
I must use this old & deprecated (by me ) object in a ASP.Net 1.1 environment... it works (aehm...) fine until I try delete the physical files I've added to the mail...
Code is like this :
.. bla bla bla...
Dim myMail As New MailMessage
myMail.From = "from@my.com"
myMail.To = "to@my.com"
myMail.Subject = "test"
myMail.Priority = MailPriority.Normal
'filename is a PDF file that exists
Dim mailAtt As New MailAttachment(sFilename)
myMail.Attachments.Add(mailAtt)
myMail.BodyFormat = MailFormat.Html
myMail.Body = xBody 'Loaded from a string
If (System.IO.File.Exists(sFilename)) Then 'to be sure
'System.IO.File.Delete(sFilename)
End If
if I delete attchment SMTP object returns me an error of "File not found" why?
|
|
|
|
|
ddepauli wrote: filename is a PDF file that exists
Dim mailAtt As New MailAttachment(sFilename)
myMail.Attachments.Add(mailAtt)
myMail.BodyFormat = MailFormat.Html
myMail.Body = xBody 'Loaded from a string
If (System.IO.File.Exists(sFilename)) Then 'to be sure Poke tongue
'System.IO.File.Delete(sFilename)
End If
if I delete attchment SMTP object returns me an error of "File not found" Confused why?
Why are you deleting the file before sending the Mail ?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
ahaha sorry I've copyed wrong code.. delete is made AFTER sending..
|
|
|
|
|
ddepauli wrote: If (System.IO.File.Exists(sFilename)) Then 'to be sure
'System.IO.File.Delete(sFilename)
End If
Does this precede invoking the Send method?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Sorry guys.....
I already posted this question.
This time i like explain clearly what i done and where i am getting problem.
I built a caluclator in .aspx page with button which look exacltly like a real caluclator.
It works fine until taking number into textbox when i click the number button
But when i click the = button the result is not displayed
i am keeping my code here....plz help me
protected void btnplus_Click(object sender, EventArgs e)
{
valholder1.Value = txtcal.Text;
sign = "+";
txtcal.Text = "";
}
protected void btnequal_Click(object sender, EventArgs e)
{
valholder2 = Convert.ToDouble(txtcal.Text);
if (sign == "+")
txtcal.Text = Convert.ToString(valholder2 + Convert.ToDouble (valholder1));
}
Here i took the valueholder1 and valueholder2 to store the values
and i want to display the result in textbox
plz help me.........
Thanx in advance
|
|
|
|
|
|
Hello,
I have placed 5 textboxes on a web page (ASP.NET using VB) and one for input of sum above 5 textboxes. I want to validate the 6th textbox something like it.. suppose sum of 5 textboxes is 1032 and now focus is in 6th (i.e. total) textbox; so here only "1032" characters should be allowed no other; and they should be in this order only; not like 1302 or something like (after pressing 1 it will accept only 0 no other key). How to get this feature please tell me. I know this can be achieved by javascript but less knowledge throw me in the forum.
Thanks & Regards
Girish Sharma
|
|
|
|
|
|
User have to feed the sum in the 6th textbox to verify the sum.
|
|
|
|
|
Hi,
Don't allow User to Calculate the Sum in which case there is a chance to enter the wrong value.
So You must calculate the value on the textChange Event of the 5th TextBox.
This is very Simple.
Bye.
Learner will gain more knowledge than Teacher.
|
|
|
|
|
This is my business need please.
User is doing the data feeding job in this web application. He will enter 5 number and 6th as sum of 5. Now if 1.user has done mistake or 2.the input source(a pre-printed data sheet which will be written by other staff) is having mistake; can be traced out and it will stop to error in database. He will only allowed to feed the right digits in the right order only or press escape key to recorrect the value(s) of above any of 5 inputs.
Thanks & Regards
Girish Sharma
|
|
|
|
|
|
|
Hi i have an html report in asp.net
I want to export html report to word ..
I am able to do that by following code ..but i want to have predefined header and footer in exported word document...
so how to set header/footer of ms-word document from asp.net code.
------------------------------------------CODE-----------
string strHTMLContent = reader.ReadToEnd();
strHTMLContent = strHTMLContent.Replace("#Education#", "BE");
strHTMLContent = strHTMLContent.Replace("#Position#", "Software Engineer");
lblmsg.Text = strHTMLContent;
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Charset = "";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;
HttpContext.Current.Response.ContentType = "application/ms-word";
string strFileName = "new1" + ".doc";
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + strFileName);
HttpContext.Current.Response.Write(strHTMLContent);
HttpContext.Current.Response.End();
HttpContext.Current.Response.Flush();
|
|
|
|
|
I am new to this .net world.
I like to know how we can run .exe files with asp.net page
plz help me.........
|
|
|
|
|
Just for performing background operations u can use it since server side process are not visible to end users
MSDN[^]
|
|
|
|
|
Anjani Poornima wrote: I am new to this .net world.
I like to know how we can run .exe files with asp.net page
Asp.Net does not build for that. if you use process start exe it will start in Server not in client side.
If you want to really do that, use ActivX and It will work only in IE.
cheers,
Abhijit
CodeProject MVP
|
|
|
|