|
Chetan Ranpariya wrote: Should I make the html file control server control and user its PostedFile.SaveAs method to copy the file instead of using textbox?
Yes! That is what it is for. What you have tried to do will never work because the path is on the client, and you're created FileInfo instance is on the server.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Hi,
Thanks for the sugession.
The way u suggest worked finely.
Now my problem has been solved.
Thanks to all the others who gave me their views.
Chetan Ranpariya.
|
|
|
|
|
Hi Folks..
I am very new at ASP.NET.
"TextBox3 = TextBox1 +TextBox2"...This is the question..
How can I get the sum of two textboxes on another third texbox by leaving te second texbox(I mean by using a tab key vice versa) . Is there any event for this (such as leavefocus?)
Please Help
|
|
|
|
|
You would do this via Javascript on the client machine rather than posting back to the server. Use the onblur event, viz: (NB: CP will replcae the word "onblur" with "removed" in the sample below):
<html>
<head>
<title></title>
</head>
<script language="javascript" >
<!--
function addTB(s) {
var r1 = document.f1.TextBox1.value + document.f1.TextBox2.value;
document.f1.TextBox3.value = r1;
}
// -->
</script>
<body>
<form name="f1" action="">
<input type="text" name="TextBox1" onblur="addTB()" >
<input type="text" name="TextBox2" onblur="addTB()" >
<input type="text" name="TextBox3" >
</form>
</body>
</html>
cheers
P
|
|
|
|
|
Thank you very much...This is the answer!!!!!!!!!!!!!!!!!
|
|
|
|
|
How to compress files in ASP.Net using VB.Net without any third party solution?
|
|
|
|
|
You can't in 1.1 as far as I know. But there is a namespace that contains classes for working with ZIP files in 2.0
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hello,
I would like some help. i have implemented a print button into a webpage, but it prints the total page, and i am looking for printer the content that is in the disclaimer box. can anyone help me on how to create this?
Thanks,
|
|
|
|
|
you can put the portion of code in div which is to be print and then onclick of the print button call a javascript function which will get the div and will print it.
|
|
|
|
|
Learning as I go and having trouble with a datagrid. Using images, and need to delete a selected record if the image is pushed or send to another page if it's edit. No errors, but don't think things are getting passed. Trying to plagarize from a help article on the web and haven't got something just right. Any help, please?
Private Sub dgCourseListItemCommand(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
if e.CommandName="Edit" then
'do a redirect with e.item.cells(0).text as url parameter
'url=http://www.servername.com/adminEcoursePageEdit.aspx?pageID= &
e.item.cells(0).text
End if
if e.CommandName="Delete" then
Dim cmdp as new sqlClient.SqlCommand("sp_eCoursePageDel",cn)
cmdp.CommandType = CommandType.StoredProcedure
Dim p_pg as SQLParameter = new SQLParameter("@pageID", SqlDbType.Int, 4)
p_pg.Value = e.item.cells(0).text
cmdp.Parameters.Add(p_pg)
cmdp.ExecuteNonQuery()
lblMsg.text=e.commandName & ", " & e.item.cells(0).text
End if
End Sub
<asp:DataGrid id="dgCourseList" OnItemCommand="dgCourseListItemCommand"
runat="server" autogenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="pageID_pk" Visible="False"></asp:BoundColumn>
<asp:boundcolumn HeaderText="Navigation Title" DataField="navTitle"
Visible="True"></asp:boundcolumn>
<ASP:TemplateColumn HeaderText="Action">
<ItemTemplate>
<ASP:ImageButton id="btnDel" Runat="server" AlternateText="Delete"
ImageUrl="../images/boxX.gif" CommandArgument='<%#
DataBinder.Eval(Container,"DataItem.pageID_pk")%>' CommandName="Delete" />
<ASP:ImageButton id="btnEdit" Runat="server" AlternateText="Edit"
ImageUrl="../images/boxCheck.gif" CommandArgument='<%#
DataBinder.Eval(Container,"DataItem.pageID_pk")%>' CommandName="Edit" />
</ItemTemplate>
</ASP:TemplateColumn>
</Columns>
</asp:DataGrid>
|
|
|
|
|
Hi there,
Why do you think it's not working? Doesn't the selecteded row get updated/deleted? Also, for the Edit button, because you only redirect the user to another page, you may consider using the HyperLink control instead of the ImageButton .
|
|
|
|
|
The item is not deleted, and when I try to write the commandName or the value of e in the datagridarguments into a label, nothing is displayed. I don't think the sub is being called. So, I then set the above label to say "to delete", but when I click the image button, nothing is displayed.
Like I said, I'm learning, so I couldn't figure out how to put mulitple images into a column using the hyperlink control and I'd prefer being able to use an update(redirect) and delete button image. Should be possible?
|
|
|
|
|
Hello everyone, hope everyone is doing well,
i was wondering how i could create a photo album using Asp.net on a web form, the main form has a drop downlist with different categories for photos, and on a different page you can Add, edit, or deleted a photo and as well as Update it. If anyone has any idea or knows a model about the codes, please help me out...Thanks in advance
|
|
|
|
|
Hi there,
You can have a look at the Personal[^] starter kit which may give you some ideas.
|
|
|
|
|
Hi!
There is a website that offers free online tutorials about asp.net and .NET in general. I searched for "dynamically generate images" and the first hit seems to be what you are looking for. Go ahead and try:
Go to http://www.KYNOU.com and use the search criteria: "dynamically generate images"
I hope it helped you.
sfdsfsdf
|
|
|
|
|
I have tried that and didnt get much help either, maybe i can rephrase my questions, sorry to do that again, what i'm tryin to do is create a photo album on VS 2003 on web form using ASP.NET, i have started alittle bit with it, and right now just stuck, i got the first page, but now i have to code the ADD,Delete, and Edit page to allow user to add more photos from the Database, delete and also edit and Also another page for full view...thanks in Advance
|
|
|
|
|
|
Hello,
Using the SqlDataSource object to declaratively bind data to a DataList which contains another DataList. Code is similar to:
<asp:DataList ID="parent">
<ItemTemplate>
<asp:DataList ID="child">
</asp:DataList>
<asp:SqlDataSource ID="childDataSource" SelectCommand="Select * FROM childTable WHERE parentId = ?" />
</ItemTemplate>
</asp:DataList>
<asp:SqlDataSource ID="parentDataSource" SelectCommand="Select * FROM parentTable" />
Basically my question is, how do I refer to the current parent datalist item in the child's datasource (what do I replace the ? with).
Sorry if this is not clear. Thanks in advance for your time.
|
|
|
|
|
Hi there,
In this case, you can define a select parameter for the child SqlDataSource control. If you are not familiar with the Parameter, you can read the document in MSDN:
Using Parameters with the SqlDataSource Control [^]
Basically, there are a couple of parameters which you can use like the generic Parameter or ControlParameter .
+ With the Paremeter, you cannot bind data from the parent datalist item to the DefaultValue property of the Parameter as the Parameter does not have the DataBinding event, so you should create an event handler for the Selecting event of the child SqlDataSource control, and populate the select parameter value in there.
+ With the ControlParameter, you can simply bind data from the parent datalist to a control like Label. If you don't want to display it in the datalist, you can set the Visible to false. Then you simply define a ControlParemeter for the child SqlDataSource control, and configure the ControlParameter to get the value from this Label control. The sample markup look like this:
<asp:DataList ID="parent">
<ItemTemplate>
<asp:Label ID="lblParentID" Text='<%# Eval("parentId")%>' />
<asp:DataList ID="child">
</asp:DataList>
<asp:SqlDataSource ID="childDataSource"
SelectCommand="Select * FROM childTable WHERE parentId = @parentId" >
<SelectParameters>
<asp:controlparameter name="parentId" controlid="lblParentID" propertyname="Text"/>
</SelectParameters>
</asp:SqlDataSource>
</ItemTemplate>
</asp:DataList>
<asp:SqlDataSource ID="parentDataSource" SelectCommand="Select * FROM parentTable" />
|
|
|
|
|
This was my first thought, however...
Exception Details: System.InvalidOperationException: Could not find control 'lblInput' in ControlParameter 'InputId'.
The SelectParameter cannot find the label because it is within the DataList's ItemTemplate. I've also tried filling in the parameter on the Selecting event and that doesn't seem to work either.
-- modified at 9:20 Tuesday 2nd May, 2006
Edit:
For now I've solved the problem by setting the select command like so:
SelectCommand='<%# "SELECT * FROM childTable WHERE parentId = " + Eval("parentId").ToString() %>'
This'll do for now, was hoping there was something built in.
|
|
|
|
|
hi,
i have a TreeView component with its data bound to and XmlDataSource object. According to different users different xml strings are generated and bound to xmldatasource and also to treeview component.
when i first login as one user, treeview is shown correctly and the xml string. but when i close the ie, and start application and login again with another user, different (i see in the test div) xml is generated(normally), but when i bound it to treeview, treeview shows the past xml data(the one which i logged in first)
why?
thanks
|
|
|
|
|
Hi there,
Looks like the XML data is cached in the XmlDataSource control. Do you have the EnableCaching property set to false ?
|
|
|
|
|
thank you very much !! it worked.
|
|
|
|
|
When I needed to learn how to use the TreeView control in VS 2005, I went to the http://www.KYNOU.com website and searched using the criteria: "treeview". Why don't you go ahead and try it.
sfdsfsdf
|
|
|
|
|
i've set XmlDataSource's EnableCaching property to false, and it worked.
thanx
|
|
|
|