 |
|
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers, Chris Maunder
The Code Project Co-founder Microsoft C++ MVP
|
| Sign In·View Thread·PermaLink | 4.57/5 (33 votes) |
|
|
|
 |
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers, Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
| Sign In·View Thread·PermaLink | 3.72/5 (226 votes) |
|
|
|
 |
|
|
 |
|
 |
Do you mean clicking on Image will display a text box?
If yes, then where and how would you like to display the text box
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
yes i mean clicking on Image will display a text box in position of mouse click . and the text box must be transparent that the picture in image control must be visible under the textbox.
M.Alizadeh
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Use DIV and Put the Textbox inside DIV. Now Show the DIV on click of Image.
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi everybody,,
I have a multiline textbox, I set its maxlength to 50, but it does not work well, it still allows to enter more than 50 chars.
how to solve this ?
Regards
Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
<textarea name="mytext" onkeypress="return (this.value.length <= 50);" ><textarea>
This does the trick.
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi All
I’ve used Obout grid with Row Template,It displays the data from the database fine, when I click edit the edit template appears when I make some changes and click save this error appears *********************************************************************** Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation ***********************************************************************
This property helped me stopping that message from appearing again <pages enableEventValidation="false" >
But then the changes are not reflected to DB ,when I debugged the following code I found out that the Event [e] which was supposed to hold the new(changed) data is holding the old data why? How to fix that? :----------------------------------------------------------------------- Sub UpdateRecord(ByVal sender As Object, ByVal e As Obout.Grid.GridRecordEventArgs) Dim myConn As SqlConnection = New SqlConnection("Data Source=GP10;Initial Catalog=Integration;Integrated Security=True") myConn.Open()
Dim m = e.Record("EmployeeID") Dim mm = e.Record("EmployeeNameA") Dim myComm As SqlCommand = New SqlCommand("UPDATE Employees SET APUsername=@APUsername, AccountNumber = @AccountNumber, EmployeeNameA=@EmployeeNameA, HasPC=@HasPC, Manager = @Manager WHERE EmployeeID = @EmployeeID", myConn) myComm.Parameters.Add("@APUsername", System.Data.SqlDbType.VarChar).Value = e.Record("APUsername") myComm.Parameters.Add("@AccountNumber", System.Data.SqlDbType.VarChar).Value = e.Record("AccountNumber") myComm.Parameters.Add("@EmployeeNameA", System.Data.SqlDbType.NVarChar).Value = e.Record("EmployeeNameA") myComm.Parameters.Add("@HasPC", System.Data.SqlDbType.Bit).Value = e.Record("HasPC") myComm.Parameters.Add("@Manager", System.Data.SqlDbType.VarChar).Value = e.Record("Manager") myComm.Parameters.Add("@EmployeeID", System.Data.SqlDbType.NVarChar).Value = e.Record("EmployeeID") myComm.ExecuteNonQuery() myComm.Dispose() myConn.Close() End Sub
-----------------------------------------------------------------------
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I guess you are talking about some ThirdParty Gird Control. It will be better if you ask there forum, so that they can give you proper solution.
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I want to put validation control for CNIC (Computed National Identity Card),
if CNIC# is: 16304-1064020-6
I want the dashes to be handled automatically. like if I first enter 16304 now if I enter another digit like in this case 1 then the dash between them is automatically putted.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Then do it. Just handle the keypress of the textboxes you want, and use javascript to put dashes between numbers.
You might also consider Regular Expression to validate the CNIC number after user input. (Might also make use of RegularExpressionValidator).
\d{5}[-|]\d{7}[-|]\d
I think this will work as regular expression. Try it. Well I agree, it can be made shorter.
Cheers.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Try this..! http://stackoverflow.com/questions/569565/uploading-files-in-asp-net-without-using-the-fileupload-server-control
LatestArticle :Log4NetWhy Do Some People Forget To Mark as Answer .If It Helps.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
FileUpload and input type="file" is the same thing. You might use either of them.
You can even trigger the Browse button click when some other control is clicked, but with normal html, it is not possible to upload the file without browser FileUpload.
May be you can use flash object to invoke openfiledialog without FileUpload control. Many sites uses Flash OpenFileDialog to have multiselection of files enabled. It wont be possible for normal html file upload control.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
lrsalunkhe wrote: Can me upload a file without file uploade control.
Why ?
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
I am sending emails through webservices, I am calling the webservice from my website and passing all the arguments to it ,until now no problem.
But now I want the webservice to inform the user if an error or exception occurs is there a way by which I can do so?
Any help shall be appreciated
Thanks Shankbond
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Return the exception in the form of String format...!
[WebMethod] Public string SendMail() { try { return "mail sent"; } Catch(Exception ie) { return ie.Message; } }
LatestArticle :Log4NetWhy Do Some People Forget To Mark as Answer .If It Helps.
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi,
Your method is very simple but when I tried to send the mail using webservice I tried like:
testingservice service=new testingservice;
string message=service.send mail(,,,.....parameters);
where as I have declared the web service as
[WebMethod] Public string SendMail(,,,.....parameters) { try { return "mail sent"; } Catch(Exception ie) { return ie.Message; } }
I get an error and the application fails to rebuild Cannot implicitly convert type 'System.IAsyncResult' to 'string'
Please reply
Thanks Shankbond
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi, You misunderstood i think..!
You have to write a web method for sending mail [WebMethod] Public string SendMail(,,,.....parameters) { try { return "mail sent"; } Catch(Exception ie) { return ie.Message; } } if you wrote the logic for sending the mail show me the code..!
LatestArticle :Log4NetWhy Do Some People Forget To Mark as Answer .If It Helps.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi, here is the code:
protected void Button4_Click(object sender, EventArgs e) { testingservice service = new testingservice(); AsyncCallback callback = new AsyncCallback(hello); service.BeginSendMailGmail1(TextBoxto.Text.ToString(), TextBoxcc.Text.ToString(), TextBoxbcc.Text.ToString(), TextBoxbody.Text.ToString(), TextBoxsubject.Text.ToString(), TextBoxusername.Text.ToString(), TextBoxpassword.Text.ToString(), TextBoxserver.Text.ToString(), TextBoxport.Text.ToString(), TextBoxdisplayname.Text.ToString(),callback,sender); Response.Redirect("default4.aspx"); }
here is the other method but it will always be completed =true
void hello(IAsyncResult result) { if (!result.IsCompleted) { Response.Write("failed"); } }
the code for webservice:
[WebMethod]
public string SendMailGmail1(string To, string Cc, string Bcc, string body,string subject, string user_name, string password, string server_name, string portnumber, string display_name) { SmtpClient client = new SmtpClient(); MailMessage message = new MailMessage(); client.Port = Convert.ToInt32(portnumber); client.Host = server_name; client.UseDefaultCredentials = true; client.Credentials = new System.Net.NetworkCredential(user_name, password); client.EnableSsl = true; try { message = new MailMessage(new MailAddress(user_name, display_name), new MailAddress(To)); if (Cc != "") { string[] array1 = Cc.Split(','); for (int i = 0; i < array1.Length; i++) { message.CC.Add(array1[i].ToString()); }
} if (Bcc != "") { string[] array2 = Bcc.Split(','); for (int i = 0; i < array2.Length; i++) { message.Bcc.Add(array2[i].ToString()); }
}
message.Body = body; message.Subject = subject; message.IsBodyHtml = true; client.Send(message); message.Dispose(); return "sent successfully"; } catch (Exception ex) { return ex.Message.ToString() + "----" + ex.InnerException.ToString(); } }
Thanks Shankbond
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
shankbond wrote: AsyncCallback callback = new AsyncCallback(hello);
I dont Understand why you need asychronous?
here is sample code i developed now Modify your code depending on your requirement...!
[WebMethod] public string SendMail() { try { MailMessage msg=new MailMessage ("From@xxx.com","To@xxx.com","Sub","body"); SmtpClient client = new SmtpClient("YourDomain", 25); client .Send (msg); return "hai"; } catch (Exception ie) { return ie.Message ; } }
For Calling Webservice..!
localhost.WebService rss = new localhost.WebService(); string msg=rss.SendMail(); Response.Write(msg); I am Going Bye May the group will help if you need further assistance..!
LatestArticle :Log4NetWhy Do Some People Forget To Mark as Answer .If It Helps.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
If The Web Service is in you application Keep the break point and check wats happening in webservice..!You can track the problem..!
LatestArticle :Log4NetWhy Do Some People Forget To Mark as Answer .If It Helps.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Cool it worked thanks.
I need the asynchronous mode only one problem left now how to pop up a message box or so, when the user is simply surfing on some other page?
Thanks Shankbond
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
HI Experts,
I have done designing on my computer...it looks good when i run it on browser..but when the same project is run on other machine which has little wider screen(19" monitor) the font,size of the controls does not remain same...i have used all HTML tables and placed controls in table... I haven't used tags....will it b the reason ? Sharing Of Knowledge Provides Solution.... |
| Sign In·View Thread·PermaLink | |
|
|
|
 |