|
but I'm trying to reach menu1 from *.master.cs file.
Thanks for info anyways.
|
|
|
|
|
Thats quite weird!!
You should be able to do that...anyways..try to figure out something im not getting any ideas
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
maybe that's because menu is in big LoginView?
|
|
|
|
|
wats a big login view??
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
LoginView is a standart control which comes with VS. I have a master page with this login view like so:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Environment.master.cs" Inherits="Optical_Box_Manamgemt_System.Environment" %>
<title>Title
<asp:loginview id="LoginView1" runat="server">
<loggedintemplate>
//Everything Goes Here, Including Menu and Content Place Holder
if you are skype user you can add me, my skype name is same as my nickname here.
Thanks for Help
|
|
|
|
|
Hi all,
iam binding a description field varchar(500) to a grid view. i want to display in the grid view the only first 20 or 30 characters only and not all the characters in this field. Is this possible? Thanks
|
|
|
|
|
Hi all,
I want to upload multiple files in ASP.Net 2.0 with the file upload control. So I have download the source code "Upload multiple files Hotmail style -
Kwame Hubbard" from the following site.
http://www.codeproject.com/aspnet/multiuploads.asp
It seems that everytime I invoke this method, it will tell me that "Error - a file name must be specified" no matter what I do. The add and remove methods work just fine.
In anycase, in the upload method, it seems to always think that filecount or ListBox1.Items.Count is equal to 0, and therefore won't proceed with the uploading.
Is it because the buttons themselves are webcontrols, while the upload is a htmlcontrol? Somehow the html control is not able to access the existing value of filecount.
So could you please help me out to solve this problem. Please its very urgent.
Thanks and Regards,
Hariharan C
|
|
|
|
|
Hello
I am not getting why you are going behind the way what the article explained ? Uploading multiple files will be such a simple task if you use gridview and normal HTML upload file control. What you need to do is
1. Place a GridView
2. Add template column
3. Add File upload control to template column and make it runat=server
4. Codebehind, use gridviews FindControl() method to find the upload control.
5. Use uploadcontrolObj.PostedFile.SaveAs(filename)
If you are uploading very huge files, you need to change something in Web.Config .
|
|
|
|
|
Hi Navaneeth,
I am not able to follow your mehtod. So could you please explain me little bit clearly with the code.
Thanks and Regards,
Hariharan C
|
|
|
|
|
Hari_1010 wrote: I am not able to follow your mehtod. So could you please explain me little bit clearly with the code.
Please let me know, Are you familiar with gridview ?
|
|
|
|
|
Yes Navaneeth, I am familiar with gridview.
|
|
|
|
|
First you need to place a gridview. Add a template column. In ItemTemplate add
<input type="file" id="MyFileUpload" runat="server">
Assume you need to upload 5 file. So you need 5 rows in grid view. For that create a dummy datatable with 5 records and bind to gridview. Now you will see gridview binding with 5 records and in each row you will get each file upload control.
Down to gridview place a button. Inside button click write
for ( int i=0;i<GridviewRows;i++)
{
HtmlInputFile fileUpload = (HtmlInputFile)GridView.Rows[i].Cells[FileUploadCell].
FindControl("MyFileUpload");
fileUpload.PostedFile.SaveAs("YourServerLocation");
}
FindControl method will find the control from gridview and give you the object. Using that object you can do upload. You need to handle exception efficiently. This will raise NullReferenceException if FindControl() is not getting the object. So make sure that you will specify the cell where FileUploadControl resides.
|
|
|
|
|
Hi Navaneeth,
Thanks for your code. But my problem is, my client dont want that much file upload control to be seen in the UI. The requirement of my client is, he needs only one file upload control and in one click he wants to select more than one file at time.
Can we create any web user control. Do you have any suggestion for that.
Thanks and Regards,
Hariharan C.
|
|
|
|
|
Hari_1010 wrote: my client dont want that much file upload control to be seen in the UI. The requirement of my client is, he needs only one file upload control and in one click he wants to select more than one file at time.
Why don't you tell this first. So whatever code I written for you in previous posts became unusable . No issues, let's start again from the scratch.
Now for this requirement we can follow the method what that article say's. But you can't reuse the article code since it won't work perfectly. You need to do some small changes in his code. You can try with this
1. Put one file upload control.( As your client said )
2. Put list box just to show the files selected. No much role in this movie
3. Place two buttons with "Add to List", and "Upload" texts.
4. OnClick of "Add to List" button, get the postedfile object and store that in one arraylist.
5. Now move arraylist to one session. ( Used to get the value across page postbaccks )
6. On Upload button click cast session to arraylist. Then cast array list object to HttpPostedFile object. Now use SaveAs() method in that object
In that article author is not using sessions. Your Upload button code would be
ArrayList ObjArr = (ArrayList)Session["files"];
HttpPostedFile postFile = (HttpPostedFile)ObjArr[0];
Response.Write(postFile.FileName);
Response.Write(postFile.ContentLength.ToString());
postFile.SaveAs(Server.MapPath("/filename.zip"));
|
|
|
|
|
Hi Navaneeth,
My problem is I want to select more than one file at one click. For example, take winamp or windows media player. If we want to play songs from a movie, what we will do is browse and select all songs.
Like that I want to work in ASP.Net 2.0. By clicking the Upload file control, I want to select more than one file at a time and I want to upload it into my database.
So could you please help me out to solve this problem. Please...its very essential for my project.
Thanks and Regards,
Hariharan C
|
|
|
|
|
Hari_1010 wrote: Like that I want to work in ASP.Net 2.0. By clicking the Upload file control, I want to select more than one file at a time and I want to upload it into my database.
Same method what I suggested will do this
|
|
|
|
|
hi friend good morning
i am using ajax panel where i have a text box.when i input like this:- <asdf
then http="" error="" 500="" occurred....error:-
"sys.webfrom.pagereqestmanagerserver="" error:an="" unknown="" occurred="" while="" processing="" the="" request="" on="" server,the="" status="" code="" returned="" from="" server="" was:500"
help="" me
=""
<div="" class="ForumSig">Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
9313077379
|
|
|
|
|
input like greater then in html and abcd
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
9313077379
|
|
|
|
|
i would like to know how to create an application were the image will change color based on the database value(example '1'=red '0'=green)
And also a code to insert table in the webform based on the input of columns and rows from a textbox
Row: 3
column: 2
next a table with 3 rows and 2 columns are created
|
|
|
|
|
Add these three controls to xml page.
<asp:textbox id="txtColumns" runat="server">
<asp:button id="btnGenerate" runat="server" onclick="btnGenerate_Click" text="Generate">
<asp:gridview id="mainDataGrid" runat="server">
then add this code behid the button on click event
DataTable dt = new DataTable();
if (txtColumns.Text.Length > 0)
{
string[] str = txtColumns.Text.Split(',');
foreach (String st in str)
{
dt.Columns.Add(st);
}
DataRow dr = dt.NewRow();
dt.Rows.Add(dr);
mainDataGrid.DataSource = dt;
mainDataGrid.DataBind();
}
You can also use switch statement for decision making in selecting color.
God Bless you.
Always do good to others
|
|
|
|
|
i'm appricate your promptnes in sending me a reply thank you
I prefer using visual basic to c# and converted your code to visual basic from www.codechanger.com
does it use 2 textboxes and 1 button
does it accept the inputs from the rows and columns
|
|
|
|
|
hi there
i would like to know wht the DataTable and DataRow is for
|
|
|
|
|
datatable is a logical table in the memory and datarow is logical row in the memory.
God Bless you.
Always do good to others
|
|
|
|
|
wht controls are added to the xml page???
|
|
|
|
|
These are controls for adding.
asp:TextBox
asp:Button
asp:GridView
God Bless you.
Always do good to others
|
|
|
|