|
Yifei Jia wrote: Console.WriteLine("Changed: {1}", e.FullPath);
Are you doing it in ASP.NET ?
|
|
|
|
|
Arrays in programming are 0 indexed. You specify {1}, which means the second argument, but you only provide one. Replace the 1 with a 0.
And as someone else said, this doesn't look remotely like ASP.NET code. In fact, it isn't.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
admin page has a detailsview
hikingpage has a gridview
problem is when i enter the second image instead of a new row the image replace's the first image and the rest of the row appears farther down the gridview
here is the codebihind that i used
Imports System.Data
Partial Class Admin
Inherits System.Web.UI.Page
Protected Sub DetailsView1_ItemInserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewInsertedEventArgs) Handles DetailsView1.ItemInserted
'If the record was successfully inserted,save the picture
If e.AffectedRows > 0 Then
Dim results As DataView = CType(SqlDataSource1.Select(DataSourceSelectArguments.Empty), DataView)
Dim PictureIDJustAdded As Integer = CType(results(0)(0), Integer)
'Reference the FileUpload control
Dim imageUpload As FileUpload = CType(DetailsView1.FindControl("imageUpload"), FileUpload)
If imageUpload.HasFile Then
Dim basedirectory As String = Server.MapPath("~/UploadedImages/")
imageUpload.SaveAs(basedirectory & PictureIDJustAdded & ".jpg")
End If
End If
End Sub
End Class
this is the codebehind on the admin page
can anyone help me out here
|
|
|
|
|
If the files are just stored in the file system, how do they stay associated with the rows of your grid as you add them ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I'm working on my first ASP.NET application ever, so this might be an easy problem to solve for you.
I'm collection data from different xml files and want to store them in an DataSet.
The data will be shown with an repeater.
The page will show something like this: (Short version, will be lots of more information)
Miami Engineering
1. General
Doc one
Doc two
2. Feasibilty calculations
Doc three
Doc four
Doc five
When I try to add the data to my DataSet the way I was thinking, I get the error "A DataTable named 'Document' already belongs to this DataSet."
This is when I try to make a DataSet with this structure:
<projects>
<project>
<projectname> Miame Engineering <projectname>
<project>
<part>
<partname> 1. General </partname>
</part>
<document>
<documentname> Doc one </documentname>
</document>
<document>
<documentname> Doc two </documentname>
</document>
<part>
<partname> 2. Feasibilty calculations </partname>
</part>
<document>
<documentname> Doc three </documentname>
</document>
<document>
<documentname> Doc four </documentname>
</document>
<document>
<documentname> Doc five </documentname>
</document>
</projects>
How will I build my DataSet so I can get the output that I want?
modified on Monday, November 17, 2008 5:03 PM
|
|
|
|
|
I am not sure why you're using a dataset, but it doesn't look to me like the data you're using is compatible, unless you specify a maximum number of doctors.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I'm using a DataSet because I want to be able to add, delete and change data in it.
What do you mean with specifying maximum number of documents?
Haven't seen that option, so how do I do that?
|
|
|
|
|
Miami Engineering
1. General
Doc one
Doc two
2. Feasibilty calculations
Doc three
Doc four
Doc five
This is a tree, with three levels. You would have to create three tables and define the relationship between them, to reproduce this structure. Not sure if .NET is smart enough to do that by itself.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i have a problem. please help.
user control is dynamically added when gridview is selected( invoice number is selected) so far so good. but when a second selection is made
the previous control appears again, naturally. so i want to register usercontrol a new every time grid is selected, how can i do that?
|
|
|
|
|
What do you mean by 'register' ? I think you want to create one control, and then move it if it already exists, b/c viewstate is causing it not to be removed ( or just explicitly remove from all rows but the selected one when you add a new one )
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
:~i'm creating a .csv file on the fly, thus am enclosing all the data within double quotes.
how to put in a newline character is the problem. for eg:-
i tried the following -
"header1","header2","header3"\n"data1","data2","data3"\n"data11","data22","data33"
and
"header1","header2","header3 \n"\r\n "data1","data2","data3 \n"\r\n "data11","data22","data33"
so that the output looks like
header1 header2 header3
data1 data2 data3
data11 data22 data33
thanks a lot for your help
|
|
|
|
|
You need to add the Carriage Return and New Line characters:
Chr(13) & Chr(10)
(in VB you can use the pre-defined ocnstant vbCrLf)
where you want the line breakx to be.
|
|
|
|
|
NEVER use \r\n, use Environment.NewLine
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I have a web service in my site, i have session statemanagement to autodetect wheter or not the browser has cookies enabled
<sessionState
mode="SQLServer"
timeout="30"
cookieless="AutoDetect"
</sessionState>
When i try to add the web reference i get an error:
There was an error downloading 'http://localhost/V01/WebService.asmx?op=PedidosNuevos'.
The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/V01/WebService.asmx?op=PedidosNuevos&AspxAutoDetectCookieSupport=1">here</a>.</h2>
</body></html>
In the add webreferece dialog, i can call the web method, i also called it from ie and it works as expected, the only problem is that i cant add it to my project as a web reference
I think it must be because of the redirection to detect if cookies are enabled
How can i add it??
Thanks for any help
Alexei Rodriguez
|
|
|
|
|
I had the same issue; The only way to solve it was to set cookieless="False" in order to add the web reference then set it back to AutoDetect.
If you find a better solution, please let me know!
|
|
|
|
|
Yes, i remember that problem, long time ago.
I had to add to reference as follows:
http://servername/WebService.asmx?WSDL&AspxAutoDetectCookieSupport=1
And i dont remember the reason why, but in my code behind in the load event i have this code:
Me.webservice.Url &= "?AspxAutoDetectCookieSupport=1"
In case you get an error add this part
Alexei Rodriguez
|
|
|
|
|
Hello,
Can somebody give me an example, how can I embed "own" asp.net Controls.
For example I can download a dll here for a special Listbox-control.
What I have to do that I can use this Control?
Thanks
|
|
|
|
|
Add to reference library maybe?
|
|
|
|
|
I added the dll allready as reference to the Project, but what now?
I think i have to create a Tag now and config something?
|
|
|
|
|
iam having datatable with the two columns when a button is click then colum1 data should replace with the column2 data.is it possible
|
|
|
|
|
Sure
foreach (datarow r in datatable.rows)
{
r[0] = r[1];
}
I didn't get any requirements for the signature
|
|
|
|
|
Hi,
I am migrating asp.net 1.1 vertion asp.net 2.0, I am getting an issue in the following code
GroupID = Guid.NewGuid.ToString
dRow.Item("ContentID") = GroupID
GroupID guid value not storing in the drow.Item("ContentID"), which stores an Guid.Empty. while debugging I found the following error
Run-time exception thrown : System.Reflection.AmbiguousMatchException - Overload resolution failed because no Public '=' can be called with these arguments
And I tried with the following code
dRow.Item("ContentID") = new guid(GroupID)
with this code I am not getting run-time error, but its storing only Guid.Empty.
Please explain, how to convert string to guid.
Thanks in advance.
|
|
|
|
|
What is the type of dRow.Item("ContentID")?
Also, you should turn on option strict and option explicit.
Did you try
dRow.Item("ContentID") = Guid.NewGuid()
|
|
|
|
|
Thanks for the reply, dRow.Item("ContentID") is System.Guid type.
I changed this guid type to string, now application is working fine.
But I have question, same code is working in 1.1 version, why its not working 2.0 version?
Thanks
|
|
|
|
|
bhupathi srinu wrote: But I have question, same code is working in 1.1 version, why its not working 2.0 version?
That's just Microsoft making sure its loyal developers have plenty of work to do. MS doesn't want things to just work, that wouldn't be any fun for the programmer now would it?
I didn't get any requirements for the signature
|
|
|
|