|
I think you forgot to use text property.
CouponName.text="";
|
|
|
|
|
thnx 4 suggestion but i want to update a gridview and CouponName is my dropdownlist in gridview which i want to update.
|
|
|
|
|
haleemasher wrote: as i m new to C# programming
OK, well, given that the error message is in plain english, I'm not sure what to suggest. If you knew how to program, I'd suggest you break this up into as many lines as you can and step through in the debugger to work out what is going wrong.
As you don't know C#, I assume you're either in a class, or teaching yourself. If you're in a class, you should talk to your teacher. If you're teaching yourself, buy a basic book on C#, BEFORE you try to learn ASP.NET.
And if this is paid work, you are an utter disgrace, and should tell your client right now that you are stealing from them. If you work for a company, I'd expect them to go broke soon, hiring people like you. Your best way forward would be to buy a C# book and work through it, in the hope that when they fail and you look for another programming job, you find yourself actually capable of doing some programming and/or understanding basic error messages.
I assume you didn't write this code. Whoever did, isn't very good. It's horrible.
CouponName =((DropDownList)row.Cells[3].FindControl("ddlCoupon")).SelectedValue.ToString();
There are at least four ways that this code could blow up, it should be on at least 4 lines, with extra code to check the assumptions being made.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
haleemasher wrote: CouponName =((DropDownList)row.Cells[3].FindControl("ddlCoupon")).SelectedValue.ToString();
insead use:
string CouponName = string.empty;
CouponName = ((DropDownList)row.Cells[3].FindControl("ddlCoupon")).Text;
|
|
|
|
|
I have no idea how a textbox is getting involved in his code, but I suspect that Cells[3] has a textbox in it, instead of a drop down. He needs to break this in to steps and use the debugger to work out what is wrong. If he's capable of it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Try this
CouponName.Text =((DropDownList)row.Cells[3].FindControl("ddlCoupon")).SelectedValue.ToString();
|
|
|
|
|
While running this code it show error A page can have only one server-side Form tag.
How i resolve it?
<form id="form1" runat="server">
<fieldset style="width:569px; top: 272px; left: 406px; position: absolute; height: 429px;">
<legend> User Login </legend>
<kswc:UltimateDatePicker ID="UltimateDatePicker1" runat="server">
</kswc:UltimateDatePicker>
<kswc:UltimateCalendar ID="UltimateCalendar1" runat="server">
</kswc:UltimateCalendar>
<kswc:UltimateDatePicker ID="UltimateDatePicker3" runat="server">
</kswc:UltimateDatePicker>
<kswc:UltimateCalendar ID="UltimateCalendar3" runat="server">
</kswc:UltimateCalendar>
</fieldset><
|
|
|
|
|
haleemasher wrote: A page can have only one server-side Form tag.
Its means your web pages contain more than one Server site Form Tag.
Read This For Solution[^]
Thanks !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
This can't be the whole page, as the form is not closed. If you have only one form on this page, there must be a form tag inside one of the controls you are including.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
My guess is that the custom control what you have inside form is generating form.Debug and see the page controls collection and remove if it has more than on server side form.Only one Form runat server is allowed.
M.Sendilkumar
|
|
|
|
|
Hi All!!
I want to create exe file of Asp.Net C# web project so that i can deploy it on any computer. Please guide me how can i do that?and what will be the requirements to deploy it on other computer having no asp.net?
Please guide me!!
|
|
|
|
|
nudma wrote: I want to create exe file of Asp.Net C# web project so that i can deploy it on any computer. Please guide me how can i do that?and what will be the requirements to deploy it on other computer having no asp.net?
An Web Based Application is not like an windows based application which can be installed in any machine. Web Based Application only be hosted on Web Server (IIS) and other user can access it from there.
Your questaions says, you are asking about Web Setup Project.
Here you go :
Visual Studio Setups (Web Setup Part I)[^]
and
Ref[^]
This may helps you
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Add web setup project to your exciting project.right click on your websetup project and select add-->project output.
a window should appear.just select ok.
Requirements for runing asp.net web page depends on target mashine but maybe you need:
1-iis
2-.net framework
3-if you use sql database ,you can install sql Express.
|
|
|
|
|
Thankyou so much it worked!!
|
|
|
|
|
you need to read a VERY basic book on ASP.NET, because it's clear you have no idea what it is, or what it does. An ASP.NET application can only run on a web server that has ASP.NET. It gets to users via the web, that's what ASP.NET is for,
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
@ Christian Graus
Thankyou so much for your kind information...
|
|
|
|
|
Hi im using VS2008 to upload and display images.
I have a control with an <asp:Image control in it... if i save the image to a file on the server and specify the ImageUrl of the control it works fine.
however i want to avoid writing the image to a file before displaying it.
first of all, can I use the <asp:Image control to display the output of a httphandler or do i need to use something like
<img alt=""httpHandler"" src=""../App_Code/ImageHandler.ashx?productid={0}"">
secondly, what if anything do i need to add to the web config? - under HttpHandlers if I add
<add verb="*" path="*" type="ImageHandler"/>
then the actual pages are not loaded - just the results of the http handler as soon as the page loads
(I guess this tells me the actual HttpHandler works as the image is displayed)
the control that wants to use the HttpHandler is in a 'Controls' directory, the HttpHandler is in the 'App_Code' directory
the ImageHandler.ashx file is:
<%@ WebHandler Language="C#" Class="ImageHandler" CodeBehind="ImageHandler.cs" %>
the ImageHandler.cs file is:
using System;
using System.Web;
using DataLinq;
using BLL = BusinesLogic;
public class ImageHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
int _productID;
if (context.Request.QueryString["productid"] != null)
{
_productID = Convert.ToInt32(context.Request.QueryString["productid"]);
}
else
{
throw new ArgumentException("No parameter specified");
}
Product product = BLL.ProductBLL.GetByID(_productID);
if (product != null)
{
context.Response.ContentType = "image/jpeg";
context.Response.BinaryWrite(product.Image.ToArray());
}
}
public bool IsReusable
{
get
{
return false;
}
}
}
Thanks,
Chas
modified on Monday, August 24, 2009 3:22 PM
|
|
|
|
|
ok managed to get this working...
The HttpHandler ashx and cs files didnt need to be seperated and the ashx file needed to be in a different directory to App_Code
I put it in a new directory called HttpHandlers...
I couldnt figure out how to use the handler with an asp:Image control (if anyone has the answer to this that would be great) so i used the img control specifying the src (wrapped in a div specifying the innerHtml)
Cheers,
Chas
|
|
|
|
|
The typical way to do this, is to write a page that takes an id on the URL, and returns the bytes of the image from the db. Then your image source url will be something like myhandler.aspx?id=23
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
When working with multiple monitors I need the user to select which monitor they are working on...any idea how I can show them a list of monitors from there machine?
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
Try to use:
screen.width
screen.height
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
You can tell the width and height of the screen, as someone said, but there is no way you can enumerate monitors with js
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I figured...but thought it was worth a try thanks for the help
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
Hello to all
I want to fix the page width in asp.net. when I add a banner to masterpage.master or add menu the width of page always changed.
Please help me how I can fix the page width?
Thanks a lot.
A good friend tell that use table. but I use it with no luck.
Are there any good article about working with table?
modified on Monday, August 24, 2009 5:52 PM
|
|
|
|
|
I think you can try wtih the Table width. That may restrict your page width.
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|