|
hi friend
i am using .net2008 on vista whree i sendind SMTP mail but error is produce :- Cannot get IIS pickup directory
when i see in intupub then there is no any mailroot folder so how i can solved this problem please help me.
Thanks
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Looks like SMTP server is not installed on your machine. Check that in the IIS settings.
|
|
|
|
|
Ok
i am using VB.net 2008 on vista there i alredy instaled IIS(all components) but there is no any mailroot folder in intupub then how i can instal SMTP Server in Windows Component in vista.
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Ohh I think VISTA won't come with SMTP server. Check this[^]
|
|
|
|
|
I've been working with ASP .NET and data for a couple months now. I'm creating a web app that is more or less a "virtual worksheet" with multiple choice questions. I get the question text and four answers from an Access database. Using data from an invisible GridView, I create Labels and RadioButtonLists at runtime and add them inside a View in my MultiView.
For I As Integer = 0 To Me.gvQMultipleChoice.Rows.Count - 1<br />
Dim lbl As New Label<br />
lbl.ID = "lblQ" & I<br />
lbl.Text = I + 1 & ". " & Me.gvQMultipleChoice.Rows(I).Cells(0).Text<br />
Me.vw1.Controls.AddAt(Me.vw1.Controls.Count - 5, lbl)<br />
Dim rad As New RadioButtonList<br />
rad.ID = "rad" & I<br />
For I2 As Integer = 0 To 3<br />
rad.Items.Add(SwitchChar(I2) & ". " & Me.gvQMultipleChoice.Rows(I).Cells(I2 + 1).Text)<br />
Next<br />
rad.RepeatDirection = RepeatDirection.Horizontal<br />
Me.vw1.Controls.AddAt(Me.vw1.Controls.Count - 5, rad)<br />
Next
Basically, make a Label, get its question text, add it to the View. Same with the RadioButtonList. This works fine. My problem is later, when I am trying to find out which RadioButton is selected. Me.vw1.Controls doesn't contain any of these Labels or RadioButtonLists.
<br />
Dim myControls As ControlCollection = Me.vw1.Controls<br />
For I As Integer = 0 To myControls.Count - 1<br />
If myControls(I).ID <> Nothing Then<br />
If myControls(I).ID.StartsWith("rad") Then<br />
Dim rad As RadioButtonList = Me.vw1.Controls(I)<br />
ans &= rad.SelectedIndex<br />
Else<br />
'ignore<br />
End If<br />
End If<br />
Next
This should work fine, I'm confident it would. But again, the problem is that the dynamically created controls aren't in the list. Does anyone know why it would be like this.
By the way, the Labels and RadioButtonLists show up, and I can select a RadioButton. The second bit of code is executed on a Button.Click event.
Thanks!
(Yes, this also in the Web Dev section. Sorry I posted there first.)
Evan Stoner
Breeze Innovations
|
|
|
|
|
When do you add the controls ? If you add them in the prerender event, then the issue is that the click event fires first.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
The controls are added in the View.Activate event. Yes, the same view that contains the dynamically-added controls and the Button that is clicked.
Evan Stoner
Breeze Innovations
|
|
|
|
|
OK, I'm not familiar with that event, I'd set breakpoints to see if it's called after you search for the controls or not.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
It's just the event that fires when the MultiView's ActiveViewIndex property is changed and the View begins to load.
Evan Stoner
Breeze Innovations
|
|
|
|
|
How to Resize a pop-up according to it's content height and width...
I've got a popup on my application and it's content is dynamic I mean sometimes it needs to be big or small according to it's content so how can i get over it...
thanks..
I found some code but it's for pictures but i want it to make the same effect according to a div or another control...
The code i found :
<title>Image
function resize() {
window.resizeTo(document.image.width+12, document.image.height+82);
}
I am not a perfect programmer,but i have perfect's programmers' habits.
|
|
|
|
|
Hi
<asp:Menu ID="Menu1" runat="server" OnMenuItemClick="Menu1_MenuItemClick" Orientation="Horizontal"><br />
<Items><br />
<asp:MenuItem Text="Main Menu" Value="Test"><br />
<asp:MenuItem Text="Second" Value="secondform.aspx"></asp:MenuItem><br />
<asp:MenuItem Text="Third" Value="thirdform.aspx"></asp:MenuItem><br />
</asp:MenuItem><br />
</Items><br />
</asp:Menu><br />
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"><br />
</asp:ContentPlaceHolder>
and my Menu1_MenuItemClick event is:
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)<br />
{<br />
Server.Transfer(((System.Web.UI.WebControls.Menu)(sender)).SelectedValue); <br />
}
When I click the menu item, URL show the previous SelectedValue. Not the page is currently shown.
Any help would be appreciated.
Thanks
Muthu
|
|
|
|
|
Hi kmuthuk,
you need to set the navigateUrl property for each menu items, then it will work
Chatura Dilan
|
|
|
|
|
I have a field in the database which is of type date time. When i return it in a grid view I want to remove the time and show only the date. Is it possible to show only the date? Thank you.
PS I am showing the date by binding the grid view.
|
|
|
|
|
The MSDN documentation has an article[^] on date/time format strings.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Ofcourse its possible,
use substring() in sql.
bofore dispaly data in the grid use substring in db
|
|
|
|
|
You can do a Convert(varchar, dateTime field, 105) for instance.
More information: here[^]
|
|
|
|
|
digimanus wrote: You can do a Convert(varchar, dateTime field, 105) for instance.
Date formatting should be done in the presentation layer. The .NET Framework provides built-in support for this. See the link in my original reply.
|
|
|
|
|
I think it CAN be done in .NET
Let the poster of this problem decide what he wants to.
things like:
DateTime dateValue = DateTime.Now
String whatTime = String.Format("{0:yyyyMMdd}", dateValue);
can also be done.
|
|
|
|
|
digimanus wrote: Let the poster of this problem decide what he wants to.
This forum is a place for people to discuss solutions to problems. If I want to critisize other people's suggestions, I will do. I certainly don't need your permission.
The basic fact of the matter is that using the T-SQL SUBSTRING is a clumsy way to format dates. If T-SQL must be used, the CONVERT function is better. IMHO, .NET provides a much richer API for data presentation and should be the tool of choice.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
biswa47 wrote:
use substring() in sql.
bofore dispaly data in the grid use substring in db
This isn't the right way to do it. The .NET Framework has support for formatting dates in different ways. See the link I provided in my original reply.
|
|
|
|
|
Hello
I'm having trouble uploading images to my sql express database. I have been searching endlessly to find a solution to my problem but to no-avail, I now turn to the trusted codeproject network for some help in solving the answer. I'm new to asp.net and am currently building an application to upload images into a database. I found the following tutorial()[^] and manipulated it to use a stored procedure. Below is the code in my code behind page:
Protected Sub btn_upload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_upload.Click
Dim intLength As Integer
Dim arrContent As Byte()
If File_Upload.PostedFile Is Nothing Then
lbl_status.Text = "Please specify an image to upload"
Exit Sub
Else
Dim Filename As String = File_Upload.PostedFile.FileName
Dim ext As String = Filename.Substring(Filename.LastIndexOf("."))
ext = ext.ToLower
Dim image_type = File_Upload.PostedFile.ContentType
If ext = ".jpg" Then
ElseIf ext = ".bmp" Then
ElseIf ext = ".gif" Then
ElseIf ext = "jpg" Then
ElseIf ext = "bmp" Then
ElseIf ext = "gif" Then
Else
lbl_status.Text = "Only gif, bmp, or jpg format files supported."
Exit Sub
End If
intLength = Convert.ToInt32(File_Upload.PostedFile.InputStream.Length)
ReDim arrContent(intLength)
File_Upload.PostedFile.InputStream.Read(arrContent, 0, intLength)
If Upload_File_Server(txt_Image_Title.Text.Trim, arrContent, intLength, image_type) = True Then
lbl_status.Text = "Image uploaded successfully"
Else
lbl_status.Text = "An Error occurred while uploading please try again"
End If
End If
End Sub
Protected Function Upload_File_Server(ByVal title As String, ByVal Content As Byte(), ByVal Length As Integer, ByVal strType As String) As Boolean
Dim command As New SqlCommand("Upload_Article_Image")
conn.Open()
Try
command.CommandType = CommandType.StoredProcedure
command.Parameters.AddWithValue("@Content", Content)
command.Parameters.AddWithValue("@Title", title)
command.Parameters.AddWithValue("@Type", strType)
command.Parameters.AddWithValue("@Length", Length)
command.ExecuteNonQuery()
Return True
Catch ex As Exception
Return False
Finally
conn.Close()
End Try
End Function
The problem I am having is that the information is not being stored in the database and the function throws up the exception. If anyone can help me it would be greatfully appricated.
Regards
McGann
|
|
|
|
|
Telling us what the error is would go a long way to helping us answer this.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for the response Christian but I searched through google and found a solution to my problem. Thanks for getting back to me.
|
|
|
|
|
use
ex.toString()
inside catch block before returning false. it will help tracing the problem
Ashish Sehajpal
|
|
|
|
|
Hi all,
I'm building a website for a friend and am at the design stage.
I would like to have a table with a row and 5 columns; an add link placed above the table.
I would like each cell to contain a type of web object (of my design) such as a text box (0,1); a drop down list (0,3) etc.
When the user clicks the add link, a second row with the same objects appear below the first row; whilst the data persists in the first row.
I'm not expecting code, but I would appreciate some help in understanding how I can accomplish this.
Thanks
Humble@!
|
|
|
|