|
AshishBasran wrote: How to specify different ASP.NET versions for the applications?
In the properties for the web site you should find the ASP.NET tab. There you can select what version of the framework the application uses.
---
b { font-weight: normal; }
|
|
|
|
|
I do not see TAB saying ASP.NET on server 2000. Though i do see the TAB on the IIS which is running on XP.
- ashish
|
|
|
|
|
Then ASP.NET is not correctly registered in IIS. Register ASP.NET using:
aspnet_regiis -i
---
b { font-weight: normal; }
|
|
|
|
|
I have registered ASP.NET using aspnet_regiis -i, still I cannot see the ASP.NET TAB in properties
By doing same I can see on the development machine but when I do same on server, the ASP.NET tab does not show up.
- ashish
|
|
|
|
|
Here is a datalist in the page, which has one columen checkbox and some databind grids.
After users click the checkbox in browser, the program should get the content of the grids.
I use the Datalist.Items[index] property, but get a string with multi grids and with html format.
How to get the text only of each item?
Thanks!
|
|
|
|
|
Hi,
I need move data from a access database to a sql 2005 database, using ado.net and VB.net
Basically, the user will select which access database to move to sql 2005, choosing from a select box on a webpage. I use an <asp:fileupload> tag to let the user select an access database(MDB file), to convert to sql 2005 database.
At the moment I can get all the data from the access database into a dataset using OleDbConnection. I just dont know how to move this information in the dataset to the sql database, in one function.
Does anyone know if there is code out there that does this, of know where I can find info on this?
Really appreciate the help.
Thanks
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
I have found error with asp.net textbox with property multiple, when i type some thing like this ' " i get error I want to catch it.
thanks
................
|
|
|
|
|
Is it the TextMode.MultiLine property that you mean?
Standard question #2:
What error message do you get?
Standard question #3:
What does your code look like?
---
b { font-weight: normal; }
|
|
|
|
|
Yes, i used TextBox.MultipleLine. Can u test it, I don't know how to tell you.
Hope you can help me
Thanks
................
|
|
|
|
|
Socheat.Net wrote: Can u test it, I don't know how to tell you.
What is it that I should test?
The textbox itself doesn't have any problems with those characters, so it has to be some other part of your code that does. As you haven't shown any of your code, and haven't explained what the error is, or if there is an error message, I have no possibility to recreate the error or even tell where it might occur.
If you are using the value from the textbox in an SQL query without coding it correctly, that could explain the problem with the apostrophes, but not the problem with the quotes.
---
b { font-weight: normal; }
|
|
|
|
|
I used it normally, when type the tag like and try to insert it into Ms Access, so I get error. I don't know how to do
................
|
|
|
|
|
What you should do, is to go back and read my first reply and answer the second and third question also. With the information you have given so far, I can only guess what the problem might be, and I have already done that.
---
b { font-weight: normal; }
|
|
|
|
|
I am dynamically creating a load of link buttons and adding them to the page as below
MyLB = New LinkButton <br />
MyLB.ID = "ObliLinkButton" & MyReader("ObligationID") <br />
MyLB.CommandArgument = MyReader("ObligationID") <br />
MyLB.CommandName = "DeleteMe" <br />
AddHandler MyLB.Command, AddressOf Me.DeleteBtn_Click <br />
MyLB.Text = "Delete" <br />
Obligationslbl.Controls.Add(MyLB)
The buttons all render as they should but when i click them they dont fire the code below
Protected Sub DeleteBtn_Click(ByVal s As Object, ByVal e As CommandEventArgs) <br />
<br />
Dim MyRecords As String = e.CommandArgument.ToString <br />
Response.Write("TheRecordIs" & MyRecords) <br />
<br />
End Sub
|
|
|
|
|
You should rebuild the items you have build dynamically after post back. Because of the stateless nature the page does not know that in the last cycle you created a button with an eventhandler. In the postback data there is written that button X fired an event, but since button X does not exist anymore after the postback (you did not rebuild it) it cannot handle that event.
|
|
|
|
|
well, you learn something new every day....
Thanks, its working now i have moved the code to load every time the page does. It means extra database hits but the trade off is worth it.
|
|
|
|
|
The thing is that the postback resets the page to it's original state, so any information regarding the dynamically created controls is lost. Why is that? Because the Page class is stateless. The Page recreates child controls based on the tags in the aspx files, so your controls not being present there are not shown. What you need to do is recreate the controls in the OnInit event or any event that fires before PageLoad, or in PageLoad if you do a check to see is the page is posted back. See this article[^] as an example.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
Hello,
I have made a small project in asp 1.1 which selects the file from a directory and shows all images with the help of array and datalist. I was also able to make previous next button.
Now My problem is I want to make a auto slideshow, I don't have ajax. I don't have any idea of java too. Can any one kindly let me know how can i make it from an array of asp.net to javascript so that the slide show works. I preassume that can be done only in java.
Or is there any way I can do it in asp.net codes.
Can I also put a browse Button so that user can choose the directory he/she wants, as I am using a textbox to put the path from where it will pickup.
Sorry for my ignorance I am learing now, kindly help.
Thanks in advance
|
|
|
|
|
I will give you a couple of pointers:
If the directories are on the server, you have to build some server side control that loops over all the directories that you want the user to be able to print from, and print these to the screen.
When the user selects a directory, the server gets all the filenames from that directory and using a loop prints it into a javascript that looks for example like this:
var images = new Array(5);
images[0] = new Array('/images/','image1.jpg','Some description maybe');
images[1] = new Array('/images/','image2.jpg','Some description maybe');
images[2] = new Array('/images/','image3.jpg','Some description maybe');
images[3] = new Array('/images/','image4.jpg','Some description maybe');
images[4] = new Array('/images/','image5.jpg','Some description maybe');
So know on the client side you will have all the info to start working on your slideshow.
Now the missing element for the slideshow, is some sort of a timer, that is where the setTimeout() drops in. Once the user clicks start slideshow, he calls to a function that looks like this:
var isSlideshow = false;
function StartSlideShow()
{
isSlideshow = true;
ShowPicture (0)
}
function ShowPicture(picId)
{
if (isSlideshow) {
document.getElementById("img").src = images[i][0] + images[i][1];
setTimeout('ShowPicture(' + picId + 1 + ')',2000);
}
}
function StopSlideShow()
{
isSlideshow = false;
}
Here you should have all your ingredients to start on your slideshow.
|
|
|
|
|
let me first thank you for you help. I am sure I can do the slide show with your kind help. But I have one more question connected to it. I am using the codes below to get an save the path as well as the file name in asp.net code
For Each s in directory.GetFiles(textbox.text.trim, "*.jpeg")
How can i make the same type of array for the path and file in java.
Thanks alot again.
|
|
|
|
|
I guess you mean javascript? Look if the folders you want to browse through are on the client side, you'll have a problem, since the browser is not allowed to do things like folder browsing etc (think of the security issues that would rise with such a feature). So then indeed you need to use Java to make a small applet that would browse folders on the harddrive. I'm not a Java expert, so I don't really know.
If we talk about folders on the server, then you indeed have to loop on the serverside through all the folder and print them to the client in HTML.
|
|
|
|
|
|
postmaster@programmingknowledge.com wrote: How to upload Images to SQL Server database using ASP.NET tools.
You can't put images in to SQL Server using ASP.NET.
ASP.NET is a technology for writing web applications. It simply does not deal with the database. If you want to do anything with the database you must use ADO.NET.
postmaster@programmingknowledge.com wrote: Visit: http://www....
If you would like to advertise your website so blatantly then I suggest you buy advertising space.
|
|
|
|
|
This is for ASP.NET 1.1 but should be easy to convert to 2.0. The stored proc inserts the file into a blob/image field in the table.
Imports System
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Public Class AttachmentDB
Private Function FileFieldSelected(ByVal FileField As System.Web.UI.HtmlControls.HtmlInputFile) As Boolean
If FileField.PostedFile Is Nothing Then Return False
If FileField.PostedFile.ContentLength = 0 Then Return False
Return True
End Function
Private Function GetByteArrayFromFileField(ByVal FileField As System.Web.UI.HtmlControls.HtmlInputFile) As Byte()
' Returns a byte array from the passed
' file field controls file
Dim intFileLength As Integer, bytData() As Byte
Dim objStream As System.IO.Stream
If FileFieldSelected(FileField) Then
intFileLength = FileField.PostedFile.ContentLength
ReDim bytData(intFileLength)
objStream = FileField.PostedFile.InputStream
objStream.Read(bytData, 0, intFileLength)
Return bytData
End If
End Function
Private Function FileFieldType(ByVal FileField As System.Web.UI.HtmlControls.HtmlInputFile) As String
' Returns the type of the posted file
If Not FileField.PostedFile Is Nothing Then _
Return FileField.PostedFile.ContentType
End Function
Private Function FileFieldLength(ByVal FileField As System.Web.UI.HtmlControls.HtmlInputFile) As Integer
' Returns the length of the posted file
If Not FileField.PostedFile Is Nothing Then _
Return FileField.PostedFile.ContentLength
End Function
Private Function FileFieldFilename(ByVal FileField As System.Web.UI.HtmlControls.HtmlInputFile) As String
' Returns the core filename of the posted file
If Not FileField.PostedFile Is Nothing Then _
Return Replace(FileField.PostedFile.FileName, _
StrReverse(Mid(StrReverse(FileField.PostedFile.FileName), _
InStr(1, StrReverse(FileField.PostedFile.FileName), "\"))), "")
End Function
Public Function InsertAttachment(ByVal fileID As Int32, ByVal FileField As System.Web.UI.HtmlControls.HtmlInputFile) As Int32
If Not FileFieldSelected(FileField) Then
Return -1
End If
Dim myConnection As SqlConnection = New SqlConnection(sqlconnection)
Dim myCommand As SqlCommand = New SqlCommand("uspInsertRequestAttachment", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
Dim parameterID As SqlParameter = New SqlParameter("@fileID", SqlDbType.Int)
parameterID.Value = fileID
myCommand.Parameters.Add(parameterID)
Dim parameterAttachmentType As SqlParameter = New SqlParameter("@AttachmentType", SqlDbType.VarChar, 100)
parameterAttachmentType.Value = FileFieldType(FileField)
myCommand.Parameters.Add(parameterAttachmentType)
Dim parameterLength As SqlParameter = New SqlParameter("@Length", SqlDbType.Int)
parameterLength.Value = FileFieldLength(FileField)
myCommand.Parameters.Add(parameterLength)
Dim parameterUploadName As SqlParameter = New SqlParameter("@UploadName", SqlDbType.VarChar, 100)
parameterUploadName.Value = FileFieldFilename(FileField)
myCommand.Parameters.Add(parameterUploadName)
Dim parameterAttachment As SqlParameter = New SqlParameter("@Attachment", SqlDbType.Image)
parameterAttachment.Value = GetByteArrayFromFileField(FileField)
myCommand.Parameters.Add(parameterAttachment)
myConnection.Open()
myCommand.ExecuteNonQuery()
return 1
End Function
End Class
Let me know if this works for you. bgates1970
|
|
|
|
|
I'm trying to open a server side MS-Word document and present it client side. I just want the word document to appear inside the browser or open up for viewing. When I run the code I'm prompted to "Open" or "Save" the file. If I "Save" the file it is the file that I requested but if I "Open" I get the following error: "This file could not be found. Try one or more of the following: * Check the spelling of the name of the document. * Try a different file name."
Code:
Dim _webClient As New System.Net.WebClient
Dim sURI aAs String = "file://C:\test.doc"
Dim theBuffer As Byte() = _webClient.DownloadData(sURI)
With Page.Response
.ClearContent()
.ContentType = "application/msword"
.AddHeader("content-disposition", "attachement;filename=test.doc")
.OutputStream.Write(theBuffer, 0, theBuffer.Length)
.End
End With
_webClient.Dispose()
bgates1970
|
|
|
|