|
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
|
|
|
|
|
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
|
|
|
|
|
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.
|
|
|
|
|
You can use JS to do that. I got a simple idea:
When left keydown, create a div (or show a div-hidden with textbox) at that point with another layer.
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 21:49pm.
|
|
|
|
|
thanks but i am a beginner in asp.net can you show me how could i do this???
M.Alizadeh
|
|
|
|
|
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)
|
|
|
|
|
<textarea name="mytext" onkeypress="return (this.value.length <= 50);" ><textarea>
This does the trick.
|
|
|
|
|
thanks dear
it works
Nour Abdel-Salam...
A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)
|
|
|
|
|
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
-----------------------------------------------------------------------
|
|
|
|
|
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.
|
|
|
|
|
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.
|
|
|
|
|
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.
|
|
|
|
|
Respected,
Can me upload a file without file uploade control.
Thanks.
|
|
|
|
|
Try this..!
http://stackoverflow.com/questions/569565/uploading-files-in-asp-net-without-using-the-fileupload-server-control
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
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.
|
|
|
|
|
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.
|
|
|
|
|
You can use js to upload file. Please refer to the following example:
<script>
function mCreateFile(obj){
var eF
var mName
mFileName.innerHTML=""
if (obj.id=="File") {
for (i=0;i <mFile.l.length-1;i++)
{
if (mFile.children[i].value=="") {
mFile.removeChild(mFile.children[i])
}
else
{
mName=mFile.children[i].value.split("\\")
mFileName.innerHTML+=" <div id=NameDetail title='"+mName[mName.length-1]+"'>"+mName[mName.length-1]+" </div>"
}
}
mstatus.innerHTML="There are <b>"+(mFile.children.length-1)+" </b> file to upload"
}
if (obj.id=="File_New") {
eF=document.createElement(' <input type="file" name="File" size="23" id=File_New onpropertychange="mCreateFile(this)">')
mFile.appendChild(eF)
obj.id="File"
}
}
</script>
April
Comm100 - Leading Live Chat Software Provider
|
|
|
|
|
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
|
|
|
|
|
Return the exception in the form of String format...!
[WebMethod]
Public string SendMail()
{
try
{
return "mail sent";
}
Catch(Exception ie)
{
return ie.Message;
}
}
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
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
|
|
|
|
|
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 :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
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
|
|
|
|
|
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 :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
If The Web Service is in you application Keep the break point and check wats happening in webservice..!You can track the problem..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
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
|
|
|
|