|
Anyone can tell me how to set up TypeName of objectDataSource in a single-file model ASPX page? Since there is no class file in single-file model, how can I set up the TypeName???
|
|
|
|
|
JimFeng wrote: single-file model ASPX page
What is it?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
What is what? Do you mean single-file model? Do you know there are two models (code-behind and sigle-file or inline) that you can use to develope asp.net application?
|
|
|
|
|
I have a gridview with a file upload:
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource2" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" GridLines="Vertical" DataKeyNames="Program_ID" Width="387px">
<Columns>
<asp:BoundField DataField="Program_ID" HeaderText="Program ID" SortExpression="Program_ID" />
<asp:TemplateField HeaderText="Image Files for Program">
<ItemTemplate>
<asp:FileUpload ID="fileUpload" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#CCCCCC" />
</asp:GridView>
For some reason, on postback, I am not getting any value from the file upload control:
foreach (GridViewRow row in GridView2.Rows)
{
FileUpload fileUpload = (FileUpload)row.FindControl("fileUpload");
if (!String.IsNullOrEmpty(fileUpload.FileName.Trim()))
{
if (chkImageFile.Checked)
{
if (String.IsNullOrEmpty(tempFileName))
{
tempFileName = fileUpload.FileName;
fileUpload.SaveAs(Server.MapPath("~/"));
}
}
else
tempFileName = fileUpload.FileName;
}
}
Any idea whats going on?
P.S. I am using ajax but for this task a i am doing a complete postback. None of the controls listed here are inside an update panel.
|
|
|
|
|
Could it be that the control be getting updated in another method being fired before the button click event?
I've never tried a fileupload in a gridview though.
I didn't get any requirements for the signature
|
|
|
|
|
I wud like to hav stunning menus for my project, and i really feel unpleasant about the menu within .Net, Plz Help?
|
|
|
|
|
Write your own or look on the web for an alternative.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
to hav stunning English in your questions, and a specific question.
Blog link to be reinstated at a later date.
|
|
|
|
|
hai all,
daily i put attendance for employee.i want to display 'x' under date in grid view.
x means present.if employee present in that date as 13-06-2008 means,i want to display 'x' under this date 13-06-2008.
i have 2 table.
emp_id and emp_name are field names for employee details table.
emp_id and date are field names for attendance table.
i use dash(-) for space in following example.
for ex,
in my employee details table values are
emp_id-------emp_name
--11----------balaji
--12----------ramu
...etc
in my attendance table values are
emp_id-------date
--11-------11-06-2008
--11-------13-06-2008
--11-------14-06-2008
...etc
here date as 11-06-2008,13-06-2008,14-06-2008 are present date for emp_id 11.but there is no date as 12-06-2008 in attendance table for emp_id 11.so that date is absent date for emp_id 11.
in web form side,
if i select employee name as balaji,fromdate as 10-06-2008 and todate as 13-06-2008 means,
i want to display 'x' under present date for emp_id 11 of emp_name balaji in grid view as follow,
emp_id----emp_name----10-06-2008----11-06-2008----12-06-2008----13-06-2008
--11------Balaji------------------------------------x---------------------------------------x
here display starting date as 10-06-2008 in above grid,because i select from date as 10-06-2008.
ending date is 13-06-2008,because i select todate as 13-06-2008.
so how to display 'x' under that present date for emp_id 11.
modified on Thursday, August 14, 2008 1:10 PM
|
|
|
|
|
Add a field to show the x and set the visible property by calling a code behind method that takes the data for the row and works out if they are present or not
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi
I have a query with the ListBox control. I have two pages on my web app, a main page and a sort page.
The main page contains a table populated with names from an SQL database.
The sort page contains a ListBox with all the names from the main page and 2 buttons, Up and Down.
The user can move the names Up and Down by clicking the name and pressing Up or Down.
Now i would like to know, How can i save the 'sorted' listBox and display that order on the Main Page??
I would greatly appreciate some help.
Many Thanks
PS this is what i have for moving the items UP/Down
protected void Button1_Click(object sender, EventArgs e)
{
int i = lstAssoc.SelectedIndex;
string str = lstAssoc.SelectedItem.ToString();
if (i > 0)
{
lstAssoc.Items.RemoveAt(i);
lstAssoc.Items.Insert(i - 1, str);
lstAssoc.SelectedIndex = i - 1;
}
}
-------------------
Redcastle CRM
|
|
|
|
|
|
Cross-poster.
Blog link to be reinstated at a later date.
|
|
|
|
|
Sorry for cross posting.
Does this mean i get no help ??
|
|
|
|
|
Hello!
If have grid for edit settings for providers, 1 row for each provider, there is a template with 2 textbox, but I have one provider that need another number of settings, how I can change the controls in template in runtime, after databind?
|
|
|
|
|
Change the column to a template column.
Put two panels in the template. On the OnRowDataBound
protected void gridRowBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
{
// Updatae Items
if (e.Row.RowType == DataControlRowType.DataRow)
{
PanelA = (Panel) e.Row.FindControl("PanelA");
PanelB = (Panel)e.Row.FindControl("PanelB");
//Put your logic to display the panel based on the data item
}
}
I didn't get any requirements for the signature
|
|
|
|
|
Hi Techies,
Please do provide me exact Cost for License of Microsoft Products that is Visual Studio .NET and MS SQL Server 2000.
Planning to buy License for being a Genuine User of Microsoft and about to developing upcoming project - using ASP.NET and MS SQL Server 2000 so i request Techies to give the detail amount - cost effective for License.
Thanks
|
|
|
|
|
|
Seriously. This has to be one of one the worst questions ever.
Blog link to be reinstated at a later date.
|
|
|
|
|
Yeah, that's a baddie
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
Which could be better for developing a online Website with huge amount of Database i.e.; PHP + MySQL or ASP.NET + MS SQL Server.
Please do lemme know..
Thanx.
|
|
|
|
|
You're honestly asking this in an ASP.NET forum on Codeproject?!?
Definitely ASP.NET + MS SQL Server.
|
|
|
|
|
PHP is better. ASP.Net sucks
I didn't get any requirements for the signature
|
|
|
|
|
Lol, is this 4real. What do you thing a bunch of ASP coders are going to say?
I don't think you should go into the programming field, because programming is all about logic and it seems like you have none.
|
|
|
|
|
Look at his question a couple posts above. WFT?!?
Blog link to be reinstated at a later date.
|
|
|
|