|
At which line you are getting error?The error says,that the id doesn't fall in index range vailable.Debug the code and check the id and available index range.
Cheers!!
Brij
|
|
|
|
|
int id = Convert.ToInt32(bcgrid.DataKeys[e.RowIndex].Values[0].ToString());
ths line gives error
|
|
|
|
|
Check the length of the collection bcgrid.DataKeys and bcgrid.DataKeys[e.RowIndex].Values and accordingly check the index
Cheers!!
Brij
|
|
|
|
|
In the code-behind, you are using DataKeyItem's Index, but you are not telling to the program what datakeys are.
For the GridView control, you have to specify DataKeyNames property.
Ashok kumar.
|
|
|
|
|
I was making a simple guestbook where i define labels(Name,mail,location and message ). i made a table for this. when i run the program . error comes that Textbox1- Text4 does not exsists in current context. following is coding that i have done.
----------------------------------------------------------------------
guestbook.aspx:-
]]>
<title>Untitled Page
Guestbook.NET
Post New Entry
Name: | <asp:textbox id="TextBox1" runat="server" xmlns:asp="#unknown"> | E-mail: | <asp:textbox id="TextBox2" runat="server" xmlns:asp="#unknown"> | Location: | <asp:textbox id="TextBox3" runat="server" xmlns:asp="#unknown"> |
Message:
<asp:textbox id="TextBox4" runat="server" xmlns:asp="#unknown">
<asp:button id="Button1" runat="server" onclick="Button1_Click" text="Submit" xmlns:asp="#unknown"> |
------------------------------------------
default.cs :-
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString);
SqlCommand cmd = new SqlCommand();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
conn.Open();
cmd.Connection = conn;
cmd.CommandText = "insert into guest values(@Name ,@email ,@location,@Message)";
cmd.Parameters.Add("@Name", SqlDbType.VarChar).Value = TextBox1.Text;
cmd.Parameters.Add("@Email", SqlDbType.VarChar).Value = TextBox2.Text;
cmd.Parameters.Add("@Location", SqlDbType.VarChar).Value = TextBox3.Text;
cmd.Parameters.Add("@Message", SqlDbType.Text).Value = TextBox4.Text;
conn.Close();
}
}
i waste my 2 hours in this program i dont know where is the problem. plz help
|
|
|
|
|
<asp:textbox id="TextBox4" runat="server" xmlns:asp="#unknown">
from this remove xmlns:asp="#unknown" and try.
|
|
|
|
|
Hello guys! happy new year to you all.I'm about to do something while having no idea about how to do it nor where to start.I'm using asp.net/c# 2.0 and code author as ORM for a web site that have registered users.In order to collect information from those users, this scenario has been ussued:after a user logged, in there should be a pop up(modal dialog) that will occasionally ask for information where in the table in the database, that information field is empty.ok supposing i have 3 tables covering the whole information needed.The ORM generated business classes so i thought i need a kind of system that will take the user guid and check in the database for empty field and prompt for it to be filled.It should ask only one question after login the whole day and not every day.First i'll like to start with how to pick the object of one of the 3 classes corresponding to 3 tables in the database and performing the checking.Thanks for reading this and thanks in advance for your solution.
eager to learn
|
|
|
|
|
Is it possible to pass an vb array object as a parameter for a javascript function or a way around it? If yes please can you explain me how? Or maybe
|
|
|
|
|
You cannot pass server side object to javascript.
You can only pass strings from server. If you data is in string format or can be converted to string. Then save that data in any control(Textbox) and access it at client end
|
|
|
|
|
|
I have created dynamically an image using the graphics and drawing options.
now i need to assign the same to the image box, how to do that?
|
|
|
|
|
You cannot directly bind the Image to image box in .net.
You need to save that image to disk and then bind it to the control
|
|
|
|
|
Put the code that creates the image in a separate page that writes the image to the response stream, so that you can use the URL of that page in the image box.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi, I am trying to used a favicon for my website. For that,
1: I had placed the "favicon.ico" image into the root directory.
2: Already put this code into head section of page 3: Deleted all the temporary files & folders and cache from internet temporary memory.
After that it is not showing the favicon in IE but showing in Morzila.
Can anybody give some idea about this problem.
Regrads,
Arun Sahoo
|
|
|
|
|
AFAIK, IE 6.0 shows favicon only for bookmarks. Have you tried to bookmark it? Also I think IE's implementation for favicon is not matching with the W3C standards.
|
|
|
|
|
Hi,I am using IE7. I had also tried by Bookmarking process. But its not working.
and also tried for after that no result.
Arun Sahoo
|
|
|
|
|
use this inside Head Tag
<link href="../Images/youricon.ico" rel="SHORTCUT ICON" />
Try it. If not coming , Click on the Logo on Address Bar ( means its should be the default ie icon) and Drag it a little bit, will resolve your problem.
cheers,
Abhijit
CodeProject.Com MVP
|
|
|
|
|
Hi Abhijit,
I had tried it. But its not working.
Have you any other idea?
Arun Sahoo
|
|
|
|
|
I have implemented the favicon in one of my sites. If the code is good give the IE some time since it does not recognise it immediately. it happened to me as well. Try to clear everything that is related to your site from the browser (like cookies), close the browser and restart it again. hope this helps you
|
|
|
|
|
The Wikipedia entry on favicon[^] covers most that you need, like recommended code and supported file formats.
Try changing the type in your link tag to the official mime type for icon files.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I have a panel with two tables. On selection of a particular option,I have to hide one of the tables.
I want the panel to position itself properly i.e. set its height\width
as if there is only one table in the panel. Currently when I hide one table there is empty space left at that position.
Yes,ideally I should put these two tables in a separate panel,but since its maintainence of very old code, want to make changes such that existing design is least affected.
I tried div option too, but it doesn't work.
Please help..Thanks in advance..
|
|
|
|
|
DIV is the best option to resolve this Issue.
PritiP wrote: I tried div option too, but it doesn't work.
What doesn't work ? Any problems or error ?
cheers,
Abhijit
CodeProject.Com MVP
|
|
|
|
|
Thanks a lot..It worked.
I was not hiding the table using style.display = "none".
|
|
|
|
|
Hope you are hiding the table by giving style.display as "none"
Check if you have given any size in pixels,if so change that to %.
|
|
|
|
|
Thanks a lot..It worked.
I was hiding the table only by setting style.visibility = "hidden"
|
|
|
|