|
Hey Please help me.
i have a login page and when user try to logon on webpage i save userId in session and i check if session is null then redirect to login else stay.
But i have that problem at if user not move the mouse or not are front the computer about 2 minutes , the session redirct to login page ? how can i disiable that funktion or what can i do .
the application is writen in C# asp.net
Thanks very mutch.
Sorry my english.
|
|
|
|
|
i think it not possible it is possible to decrease session or increase session in web.config at your connection string......
<connectionstrings>
<add name="TRDConnectionString" connectionstring="Data Source=(local);Initial Catalog=Trade;User ID=123;Password=123;timeout=60" providername="System.Data.SqlClient">
your can increase or decrease the TimeOut optin.........
send feed back to sk.haneef@gmail.com
|
|
|
|
|
thank you.
But how can i do it ?
do you have any idea?
|
|
|
|
|
i think it not possible it is possible to decrease session or increase session in web.config at your connection string......
add name="TRDConnectionString" connectionString="Data Source=(local);Initial Catalog=Trade;User ID=123;Password=123;timeout=60" providerName="System.Data.SqlClient"
your can increase or decrease the TimeOut optin.........
send feed back to sk.haneef@gmail.com
|
|
|
|
|
Hello,
I forget the what code looks like, but it is do-able.
You can search at google, with keyword "setting session in web config asp.net".
I'm sorry, but i really forget. :p
|
|
|
|
|
I am working on a website of party organizing website. But there me need a feature to import the contact in hotmail,yahoo and gmail to my database. How its possible? Can any one give me the sample codes to develop the feature. Please help me.
I have searched the site, from there they are giving paid services. So how to develop the things? Can any one give me the code?
thanks
|
|
|
|
|
Hai all,
I want to use Microsoft.VisualBasic.Devices in my page.But i am getting only Microsoft.VisualBasic. device is not getting.Shall i need to add any dll for tat?
Plse give me some instruction.
Thanks in advance
Regrds
Lijo Rajan
|
|
|
|
|
Hi from my local host i can able to send mail to my mailid,
So i copy that ddl in to my server and send mail to my mailid using my website,
Its sending only mail its not sending that attachment file,,
Whats the probs i cant find it,
Same time the mail sending only to my gmalid that also sending in spam,
If i send to my yahooid its not sending at all,plz anyone help me of this probs,
This is my code:
'Here saving some datas to my table using stored procedure after that using sub procedure call that mail send
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
If fileUpload.PostedFile.FileName <> "" Then
Dim strInsertproc As String
Dim sqlconn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
sqlconn.Open()
strInsertproc = "SubmitTravelExpMain '" & txtuserloginempid.Text & "','01/23/2008','" & _
txtuserloginprojectid.Text & "','" & txtDestination.Text & "','" & _
Mid(txtFDate.Text, 4, 3) & Mid(txtFDate.Text, 1, 3) & _
Mid(txtFDate.Text, 7, 4) & "','" & Mid(txtTDate.Text, 4, 3) & _
Mid(txtTDate.Text, 1, 3) & _
Mid(txtTDate.Text, 7, 4) & "','1213','937','" & Val(txttotal.Text) & "','" & Val(txtadv.Text) & "'"
Dim sqlcmd As New SqlCommand(strInsertproc, sqlconn)
sqlcmd.ExecuteNonQuery()
mailsend()
sqlcmd.Dispose()
sqlconn.Dispose()
lblmessage.Text = "Your Expense Statement Has Been Uploaded Successfully..."
binddata()
Else
lblmessage.Text = "Plz Attach A File..."
End If
End Sub
Sub mailsend()
Dim objMail As New MailMessage
Dim objAttach As MailAttachment
Dim objConn As SmtpMail
Dim postedFile = fileUpload.PostedFile
Try
strPath = Path.GetFullPath(postedFile.FileName)
Catch
End Try
strdate = CDate(lbldate.Text)
If Mid(strdate, 2, 1) = "/" Then strdate = "0" & strdate
If Mid(strdate, 5, 1) = "/" Then strdate = Left(strdate, 3) & "0" & Mid(strdate, 4, 6)
strdate = Mid(strdate, 4, 3) & Mid(strdate, 1, 3) & Mid(strdate, 7, 4)
objMail.From = "info@bumigrp.com"
objMail.To = "mageshkumarh@gmail.com"
objMail.Bcc = "mageshmca10@yahoo.com"
objMail.Subject = "Travel Expense Statement of " & txtuserloginempname.Text & "(" & txtuserloginprojectname.Text & ")"
objMail.Body = "Date : " & strdate & " Time - " & hh & " : " & mm & vbCrLf & "Place : " & txtuserloginprojectname.Text & vbCrLf & "Dear Sir," & _
vbCrLf & txtDestination.Text & vbCrLf & " Kind Attention - Plz refer my travel expense details." & vbCrLf & "Regards" & vbCrLf & txtuserloginempname.Text
objMail.Priority = MailPriority.Normal
Try
objAttach = New MailAttachment(strPath)
objMail.Attachments.Add(objAttach)
Catch
End Try
objConn.Send(objMail)
End Sub
Thanks & Regards,
Mageshh,
please don't forget to vote on the post
|
|
|
|
|
Public Function SendMail(ByVal FromEmailID As String, ByVal FromName As String, ByVal ToEmailID As String, ByVal ToName As String, ByVal Subject As String, ByVal Body As String, Optional ByVal IsHtml As Boolean = False, Optional ByVal OutMsg As String = "Mail has sent successfully") As String
Try
Dim message As Mail.MailMessage = New Mail.MailMessage()
message.From = New MailAddress(FromEmailID, FromName)
' To address collection of MailAddress
message.To.Add(New MailAddress(ToEmailID, ToName))
message.Subject = Subject
' CC and BCC optional
' MailAddressCollection class is used to send the email to various users
' You can specify Address as new MailAddress("admin1@yoursite.com")
' message.CC.Add("admin1@yoursite.com")
' message.CC.Add("admin2@yoursite.com")
' You can specify Address directly as string
' message.Bcc.Add(New MailAddress("admin3@yoursite.com"))
' message.Bcc.Add(New MailAddress("admin4@yoursite.com"))
'Body can be Html or text format
'Specify true if it is html message
message.IsBodyHtml = IsHtml
' Message body content
message.Body = Body
' Send SMTP mail
Dim mailClient As System.Net.Mail.SmtpClient
mailClient = New System.Net.Mail.SmtpClient("smtp.gmail.com")
'This object stores the authentication values
Dim basicAuthenticationInfo As New System.Net.NetworkCredential("useremailID", "user password") ' replace ur email id and password of your email id
'Put your own, or your ISPs, mail server name onthis next line
mailClient.Host = "smtp.gmail.com"
mailClient.UseDefaultCredentials = False
mailClient.Credentials = basicAuthenticationInfo
mailClient.EnableSsl = "1"
mailClient.Send(message)
SendMail = OutMsg
Return SendMail
Catch ex As Exception
SendMail = ex.Message
Return SendMail
End Try
End Function
This is haneef.............................................................
|
|
|
|
|
Hi Mr.Haneef,
Thanks for ur reply,
I dont know whats the diff b/w ur code and my code...,
I said i can able to send mail,
but its not attaching the file,
Plz reply regarding that
Thanks & Regards,
Mageshh,
please don't forget to vote on the post
|
|
|
|
|
|
I have a HTML FileInput control to choose an image. Now I want to choose some particular image file from that control and after that one another button will upload the image to ~\images\ folder in my server as thumbnail as well as general image. How....
Please help me.....
Thanks in advance
Tapas
|
|
|
|
|
Resize image ? Try Image.GetThumbNail() . It will give you good results if your image having embedded thumbnail. If not use Bitmap and Graphics classes to draw an image at your size.
|
|
|
|
|
First you have to upload the file as it through HtmlInputFile. Then you can chose to validate its type, get its thumbnail image, resize it.
I have also shared a few tips on image validation and format conversion over here:
http://www.dotnetspider.com/kb/Article3446.aspx[^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
GetThumbnail will work perfectly with images which have thumbnails embedded. But I always prefer to use Graphics and Bitmap classes as it gives full handle to resize the image.
|
|
|
|
|
Hai,
What are the benefits of using IEnumerator over other Loops??
Thanks in Advance,
Sunil Nair
|
|
|
|
|
Suryanairg wrote: What are the benefits of using IEnumerator over other Loops??
It provides way to iterate through the collection using a foreach.
|
|
|
|
|
Hi all,
Can you please let me know a data bound control in ASP that can bind to a result from a stored procedure and refreshes the result by itself?
I think i may need a code in Javascrpit for refreshing data by itself?
More detailed :
I want an asp page which displays all the orders from a sql server table.
I want to be able to refresh this page automatically whenever a new order
is inserted into the SQl server table.
Please advice
Thank you
modified on Thursday, January 24, 2008 6:38:07 AM
|
|
|
|
|
write code in one function call that function every time after u done of modifcation.....
example:
public sub binddata()
'below is ur code
.................
............
grdview1.Datasource=ds
grdview1.Databind()
..............
............
end sub
call this bindata() function after your modications(add , update.......)
please send feed back to : sk.haneef@gmail.com whether it is usefull or not to improve my services to codeproject.com
This is haneef.............................................................
|
|
|
|
|
Thank you very much.
Let me explain what i exactly need :
Is there a way to automatically refresh a control on the page without the user generating an event? For example, can I refresh a datagrid on a page every 5 seconds?
Thank you very much for your help.
|
|
|
|
|
if u want to refresh for every second use this code
if u want to refresh for every
5 min use this code and it will redirected to this url http://www.lowefamily.us/
<META HTTP-EQUIV="refresh"
content="1;URL=http://www.lowefamily.us/">
place this code head tag in ur aspx page
example:
This is haneef.............................................................
|
|
|
|
|
in a gridview i have dropdown and a button in each row.
on RowCommand event i have passed the id of the row as CommandArgument and getting it. How will
i get which option the user has selected in dropdownlist. i had populated the dropdownlist in the pageload event. How to get the selected dropdownlist on click of the button on individual rows.
Please can anyone help me
|
|
|
|
|
Dim i As New Integer
For i = 0 To griview1.items.count - 1
'below line find your dropdownlist in grid line by line
Dim dropdown As DropDownList = CType(griview1.items(i).Findcontrol("dropdownlist"), DropDownList)
Dim lstDrp As String = dropdown.SelectedItem.Value
Next
litdrp give u each line dropdown selected value write accoding your requirement
please send feed back to : sk.haneef@gmail.com whether it is usefull or not to improve my services to codeproject.com
This is haneef. send feed back to sk.haneef@gmail.com
|
|
|
|
|
hi fileupload html control i need only select option..,
In that enduser cant type instead of browse file...,
How to do that
Thanks & Regards,
Mageshh,
please don't forget to vote on the post
|
|
|
|
|
Why? Some users will be happier typing.
|
|
|
|