|
Subin Alex wrote: Try redirecting that page u want to get refreshed
No at all. He is asking some thing different !! and its all about window.opener.RefereshPresentPage();
cheers,
Abhijit
CodeProject.Com MVP
|
|
|
|
|
On closing the popwindow ragister a javascript function like in popup page
Page.ClientScript.RegisterStartupScript(this.Page, this.GetType(), this.ClientID + "_1", "CloseWindowandRefreshParent();", true);
put this javascript function in popup page
function CloseWindowandRefreshParent()
{
window.opener.RefereshPresentPage();
window.close();
}
And put below javascipt function in the parent page
function RefereshPresentPage()
{
window.location.href = window.location.href;
}
Cheers!!
Brij
|
|
|
|
|
It all about window.opener.RefereshPresentPage();
cheers,
Abhijit
CodeProject.Com MVP
|
|
|
|
|
Hi,
Can Any one give me an idea of how to set the Focus to Next Control when Pressing Enter Key which will suit all browsers.
Thanks.
|
|
|
|
|
|
can any one please guide me how can i get rid of this problem my control is placed inside update panel.
umerumerumer
|
|
|
|
|
Remove it from update panel then it will return true.It is due to postback.
|
|
|
|
|
Thanks Solved....
umerumerumer
|
|
|
|
|
Check IsPostBack On Pageload.
|
|
|
|
|
Hi all,
Below is my gridview
<asp:gridview id="bcgrid" runat="server" datakeynames="msg_ID" editrowstyle-font-size="XX-Small" editrowstyle-font-bold="true" font-names="Verdana" font-size="XX-Small" forecolor="DimGray" width="368px" autogeneratecolumns="False" onrowdeleting="bcgrid_RowDeleting" onrowediting="bcgrid_RowEditing" allowpaging="True" onpageindexchanging="PageRecords" pagesize="20" xmlns:asp="#unknown"> <columns> <asp:templatefield headertext="Language"><itemtemplate>
<asp:label id="p" runat="server" text="<%#DataBinder.Eval(Container, " dataitem.msg_language").tostring()="" %&>"=""> <itemtemplate>
<asp:templatefield>
This is the code for deleting a row
protected void bcgrid_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int id = Convert.ToInt32(bcgrid.DataKeys[e.RowIndex].Values[0].ToString());
Delete(id);
}
I am getting the error
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Can anybody help me in come out of this error
Thanks in Advance
|
|
|
|
|
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.
|
|
|
|