|
|
I assume this is a javascript problem with a timer on the client ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Dear ALL,
i need to have a button which is requireed to fire a function of my choice upon click from the gridview control.
Actually I Want to get the row index or the unique key of the row to be passed as parameter to my function.
So Far I have been able to get buttons to fire sql commands but not to fire my own .net function
Thank you!
Nauman
"Mess with the Best, Die like the rest"
|
|
|
|
|
u can use e.rowIndex
www.codepal.co.nr
Regards
Sean
http://www.codepal.co.nr
|
|
|
|
|
i want to save some flage in the Application
as Application["ID"];
i want to delete this Flag when the session ends
but when the user clicks (X) button in the browser the Session_End lates
i heared that Session.TimeOut is 20 minutes as Default.
i dont have problem when the user Clicks SignOut coz i will delete the Flag immediatly.
how can delete this flag immaediatly when he Clicks (X).
the whole purpose is to prevent the users to log in from defferent Sessions at the same time
regards
|
|
|
|
|
You can use AJAX to tell you when a user closes the browser. That's your only option. It won't work if the computer loses power, then you can't do anything.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
go for Ajax
Regards
Sean
http://www.codepal.co.nr
|
|
|
|
|
dear sir,
i want to store images in database, how can i store and retrive it???
if u have any code for this plz send me soon. this is very argent. i need c# code.
thanks..................
yogesh
|
|
|
|
|
It's argent. I see. Well, first of all, if you typed this question into google, you'd get your answer. However, if you want to show your images on a website, they need to exist in the file system, so you probably need to store paths to local files in the DB, not the image data.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
sir i have code for it in only c#, i am not able to implement this code in asp.net(c#), so any suggesion for it if give me
yogesh
|
|
|
|
|
OK, I'll try again. I'm a sucker for punishment.
If you have C# code for storing images, it will work in ASP.NET, because ASP.NET has NOTHING to do with your database, unless you choose to use really nasty ASP.NET controls that take SQL. Either way, the thing that won't work, is to pull images out of the db and embed them in a page. For this, they need to be on the file system. Which is why it's better to store the paths.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Actually, he can do it with [for example] httphandler, and still show it in the webform, they don't need to be on the file system.
|
|
|
|
|
Hi
Please check this site [^]. Even though the code is in VB.Net you will get the same properties and methods in C# also.
Retrieving the image can also be made from the same [site]
Regards
Meeram395
|
|
|
|
|
I knew that it was trivial to find info on this with google, but as he's using ASP.NET, what are the odds that he's storing images he doesn't want to show in a web page ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
just store the image path into database
And for retrive use this one ariticle
Retrive Image from database[^]
Happy Programming
-----
Abhijit
|
|
|
|
|
hope it helps..
Regards
Sean
http://www.codepal.co.nr
|
|
|
|
|
its quite easy and not as complicated as u think.
im pasting the whole funny code here...use it as u like
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
public partial class SQLBinary : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//UploadImage();
}
public void UploadImage()
{
// Creating a bytearray[] from the input image
int ImgLen = FileUpload1.PostedFile.ContentLength;
string strSQL="";
byte[] FileImg = new byte[ImgLen];
FileUpload1.PostedFile.InputStream.Read(FileImg, 0, ImgLen);
// Inserting the image to DB
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["connstr"].ToString());
try
{
con.Open();
strSQL = "INSERT INTO TESTIMAGE (EIMAGE) VALUES (@pic)";
SqlCommand cmd = new SqlCommand(strSQL, con);
cmd.Parameters.AddWithValue("@pic", FileImg);
cmd.ExecuteNonQuery();
}
finally
{
con.Close();
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
UploadImage();
}
protected void Button1_Click(object sender, EventArgs e)
{
MemoryStream stream = new MemoryStream();
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["connstr"].ToString());
try
{
con.Open();
SqlCommand command = new SqlCommand("SELECT EIMAGE FROM TESTIMAGE", con);
byte[] image = (byte[])command.ExecuteScalar();
stream.Write(image, 0, image.Length);
Bitmap bitmap = new Bitmap(stream);
//To SERVE
//Response.ContentType = "image/gif";
//bitmap.Save(Response.OutputStream, ImageFormat.Gif);
//TO SAVE
bitmap.Save(Server.MapPath("image")+ "/" + "aa.jpg");
Image1.ImageUrl = Server.MapPath("image")+ "/" + "aa.jpg";
}
finally
{
con.Close();
stream.Close();
}
}
}
Regards
Bino
http://www.codepal.co.nr
|
|
|
|
|
page1.aspx has link button. when you click linkbutton then it will open a popup window name page2.aspx.
1. when you click page2.aspx close button then it will close page2.aspx and refresh my page1.aspx
2. without closing page2.aspx you can not go back page1.aspx
how can i do it.
Thanks
Sarfarj Ahmed
|
|
|
|
|
Instead of just passing on the specification that you got, ask your own questions.
I could do your job for you, if you would pass on your paycheck too.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
i guess there is a modal option in window.popup in javascript.
something like showModalDialog
Regards
Sean
http://www.codepal.co.nr
|
|
|
|
|
Default Need Help with ASP.NET implementation of FCKeditor
I've got a page with the FCKeditor on it. The editor works fine,
however, since there is no documentation on ASP.NET implementations, I
can't figure out how to access the editor text in my C# code-behind. I
was about to experiment with some javascript that would put the editor
text value into a hidden text field so I could access it but that seems
like a goofy way of doing it. Help anyone?
|
|
|
|
|
|
Hello
Anyone please Help me in Solving the bug.I used below code when run locally(i.e visual studio 2005) The mail is sending properly.Wheres i Host in the Server and run.Its giving problem that failure in sending mail.
IN webconfig file
<appSettings>
<add key="MyMailServer" value ="mail.a4mgroup.com"/>
<add key="MyMailServerPort" value ="25"/>
</appSettings>
in form
<%@ import Namespace="System.Net" %>
<%@ import Namespace="System.Net.Mail" %>
Dim mMailServer As String
Dim mTo As String
Dim mFrom As String
Dim mMsg As String
Dim mSubject As String
Dim mPort As Integer
Dim strMsg As String
strMsg = "<table><tr><td>Simple Mail</td></tr></table>"
mFrom = Trim("info@a4mgroup.com")
mSubject = Trim("Your Purchase Detail")
Dim strMessage As String = strMsg
strMessage = "<html><head><title></title></head><body>"
strMessage = strMessage & strMsg & "</body></html>"
mMsg = Trim("Dear") & " " & name
mMailServer = ConfigurationManager.AppSettings.Get("MyMailServer")
mPort = ConfigurationManager.AppSettings.Get("MyMailServerPort")
Dim message As New MailMessage(mFrom, mTo, mSubject, strMessage)
Dim mySmtpClient As New SmtpClient(mMailServer, mPort)
message.IsBodyHtml = True
mySmtpClient.Credentials = New System.Net.NetworkCredential("it@a4mgroup.com", "it123")
message.Priority = MailPriority.High
mySmtpClient.UseDefaultCredentials = True
mySmtpClient.Send(message)
Catch ex As FormatException
Label14.Text = ex.Message
Catch ex As SmtpException
Label14.Text = ex.Message
Catch ex As Exception
Label14.Text = ex.Message
Finally
myReader.Close()
myConnection.Close()
End Try
Thanks in advance
Regards
Ebenezer
|
|
|
|
|
1 - don't double post
2 - please tell me that you don't have a variable called label14 ?
3 - obviously ths means there's a problem with your mail server. Do you get any more detailed feedback ? This this a mail server that should just work anywere ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello
Anyone please Help me in Solving the bug.I used below code when run locally(i.e visual studio 2005) The mail is sending properly.Wheres i Host in the Server and run.Its giving problem that failure in sending mail.
IN webconfig file
<appsettings>
<add key="MyMailServer" value="mail.a4mgroup.com">
<add key="MyMailServerPort" value="25">
in form
<%@ import Namespace="System.Net" %>
<%@ import Namespace="System.Net.Mail" %>
Dim mMailServer As String
Dim mTo As String
Dim mFrom As String
Dim mMsg As String
Dim mSubject As String
Dim mPort As Integer
Dim strMsg As String
strMsg = ""
mFrom = Trim("info@a4mgroup.com")
mSubject = Trim("Your Purchase Detail")
Dim strMessage As String = strMsg
strMessage = "<title>"
strMessage = strMessage & strMsg & ""
mMsg = Trim("Dear") & " " & name
mMailServer = ConfigurationManager.AppSettings.Get("MyMailServer")
mPort = ConfigurationManager.AppSettings.Get("MyMailServerPort")
Dim message As New MailMessage(mFrom, mTo, mSubject, strMessage)
Dim mySmtpClient As New SmtpClient(mMailServer, mPort)
message.IsBodyHtml = True
mySmtpClient.Credentials = New System.Net.NetworkCredential("it@a4mgroup.com", "it123")
message.Priority = MailPriority.High
mySmtpClient.UseDefaultCredentials = True
mySmtpClient.Send(message)
Catch ex As FormatException
Label14.Text = ex.Message
Catch ex As SmtpException
Label14.Text = ex.Message
Catch ex As Exception
Label14.Text = ex.Message
Finally
myReader.Close()
myConnection.Close()
End Try
Thanks in advance
Regards
Ebenezer
|
|
|
|