|
when i press back button in IE the previous web page dosn't reload, it shows the old data
how can i make the page reload when i press the back button on IE??
-- modified at 4:50 Tuesday 11th September, 2007
|
|
|
|
|
What you want to do ? means how your appliction should behave wheh user click back button of IF
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
thanx i solved the problem
thank you for help
|
|
|
|
|
Hi
How should we use ajax and prevent abuse . Http handlers can be called by anyone. What is the way to use ajax and just limit usage to only that page. in the code below:
xmlHttpObj.open('GET','http://' + location.host +<br />
myserver.ashx', true);
anyone who see the source code can recover the serving page
|
|
|
|
|
I add certain controls to table than i add the table to panel every time user preses add conrtrol than i write some text in the controls added and press submit but when i try to acess the table from the panel. the panel has no table
|
|
|
|
|
u must override OnInit Event and place codes in this section
or send me, your codes for check it and reply to u.
We Can Do Anything, If We Want It
|
|
|
|
|
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;
public partial class _Default : System.Web.UI.Page
{
//System.Collections.ArrayList ar = new System.Collections.ArrayList();
Table table = new Table();
Table outtable = new Table();
//Table table;
// Table outtable;
protected void Page_Load(object sender, EventArgs e)
{
//if ((Session["isaddclicked"] != null) && ((bool)Session["isaddclicked"]))
//{
// if (Session["controlsArray"] != null)
//{
// // ar = (System.Collections.ArrayList)Session["controlsArray"];
// table = (Table)Session["controlsArray"];
// }
//pnContralPanel.Controls.Add(table);
//pnoutputpanel.Controls.AddAt(0,outtable);
// }
//for (int i = 0; i < ar.Count; i=i+2)
//{
// //co (Control)ar[i];
// pnContralPanel.Controls.Add((Control)ar[i]);
// pnContralPanel.Controls.Add((Control)ar[i + 1]);
//}
//pnContralPanel.Controls.Add(table);
}
protected void btnAdd_Click(object sender, EventArgs e)
{
Control tdddddd=pnContralPanel.Controls[0];
if (Session["controlsArray"] != null)
{
table = (Table)Session["controlsArray"];
//pnContralPanel = (Panel)Session["controlsArray"];
}
//Session["isaddclicked"] = true;
String controltoadd = ddControlList.SelectedItem.Text;
Control obj = null;
Label lbl= new Label();
lbl.Text = txtCaption.Text;
if (controltoadd == "Text Box")
{
TextBox tb= new TextBox();
//tb.ID="txt"+txtCaption.Text;
tb.Text=txtValues.Text;
obj = tb;
}
else if (controltoadd == "Drop Down")
{
DropDownList dd = new DropDownList();
//dd.ID = "dd" + txtCaption.Text;
char[] ch={','};
String[] sepstring = txtValues.Text.Split(ch);
for (int i = 0; i < sepstring.Length; i++)
{
dd.Items.Add(sepstring[i]);
}
obj=dd;
}
else if (controltoadd == "Check Box")
{
CheckBox cb = new CheckBox();
//cb.ID = "cb" + txtCaption;
cb.Text = txtValues.Text;
obj = cb;
}
else
{
return;
}
TableRow tr=new TableRow();
tr.Cells.Add(new TableCell());
tr.Cells.Add(new TableCell());
tr.Cells[0].Controls.Add(lbl);
tr.Cells[1].Controls.Add(obj);
table.Rows.Add(tr);
Session["controlsArray"] = table;
table.ID = "abc";
pnContralPanel.Controls.Add(table);
//Session["controlsArray"] = pnContralPanel;
//pnContralPanel.Controls.AddAt(0, table);
ViewState["state"] = pnContralPanel;
}
protected void Button1_Click(object sender, EventArgs e)
{
// int idcdd=this.Controls.Count;
Session["isaddclicked"] = true;
// pnContralPanel = (Panel)ViewState["state"];
int c=pnContralPanel.Controls.Count;
//string s = pnContralPanel.Controls[0].GetType().ToString();
//cd = (Control)pnContralPanel.Controls[0];
Table t = (Table)pnContralPanel.Controls[0];
//Control tbcontrol = pnContralPanel.Controls[0];
//Table t = (Table)tbcontrol;
// table = (Table)pnContralPanel.Controls[0];
for (int i = 0; i < table.Rows.Count; i++)
{
TableRow toutr = new TableRow();
toutr.Cells.Add(new TableCell());
toutr.Cells.Add(new TableCell());
TableRow tr = t.Rows[i];
for (int j = 0; j < tr.Cells.Count; j++)
{
Control cn = tr.Cells[j].Controls[0];
Type tobj = cn.GetType();
switch (tobj.ToString())
{
case "System.Web.UI.WebControls.Label":
Label caption = (Label)cn;
Label ongoinglbl = new Label();
ongoinglbl.Text = caption.Text;
toutr.Cells[j].Controls.Add(ongoinglbl);
break;
case "System.Web.UI.WebControls.TextBox":
TextBox txt = (TextBox)cn;
Label value = new Label();
value.Text = txt.Text;
toutr.Cells[j].Controls.Add(value);
break;
case "System.Web.UI.WebControls.DropDownList":
DropDownList dd = (DropDownList)cn;
Label value1 = new Label();
value1.Text = dd.SelectedValue;
toutr.Cells[j].Controls.Add(value1);
break;
case "System.Web.UI.WebControls.CheckBox":
CheckBox cb = (CheckBox)cn;
Label value2 = new Label();
if (cb.Checked)
{
value2.Text = "yes";
}
else
{
value2.Text = "no";
}
toutr.Cells[j].Controls.Add(value2);
break;
}
}
outtable.Rows.Add(toutr);
}
pnoutputpanel.Controls.AddAt(0,outtable);
// Session["outTable"] = outtable;
}
}
|
|
|
|
|
I want to work my aspx pages from IIS undependantly.
How could i do?
I aim to create a demonstration CD.
it is a training Cd like CDs in MS Mocs.
i have list of subjects at left and slides at right.
|
|
|
|
|
You can't. The best you can do is to save the html files it generates, and then modify them so that all the links on them link directly to other html files you have created. No postback is going to occur, how successful this can be would depend entirely on how static your site is. If it has a forum, for example, forget it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How to free-memory(Dispose) for an specific object created an an instance of a class.
any suggestions
Thanks&Regards,
Priya.
|
|
|
|
|
is it is in C# then
objectname=null;
else (in VB)
objectname=nothing;
|
|
|
|
|
Thanks fr d same.
Thanks&Regards,
Priya.
|
|
|
|
|
Priya Cool wrote: How to free-memory(Dispose) for an specific object created an an instance of a class.
.NET manages the garbage collection automatically. You don't have to worry about clearing the objects. This will be done by .NET runtime automatically. But some classes implements IDisposable interface, which should be disposed by calling Dispose() method manually.
|
|
|
|
|
Hi to all
How can we obtain the IP address of the client in a http handler code from the context object? Or any other way ?
Thanks in advance
|
|
|
|
|
string ClientIp = Request.UserHostAddress;
We Can Do Anything, If We Want It
|
|
|
|
|
hi all
i have a gridview in a webpage, i set the datasource property of gridview to a datable so it will display the record available is the table now i have a delete button for each row in gridview but i cant able to do the code for delete button, the problem is how could i find the id for the record to which i click on delete button.
plz some body help me for the same
regards
Yogesh Agarwal
|
|
|
|
|
yogesh_kumar_agarwal wrote: but i cant able to do the code for delete button, the problem is how could i find the id for the record to which i click on delete button.
For this you need to keep one primary column on your datatable. When binding to gridview make this column to invisible. Eventhough it is invisible, you can access it by specifying the cell. So when delete button got click, you need to find out this hidden value. This will be the key for the record to be deleted.
|
|
|
|
|
Thanks for the reply but
I know these whole things, the problem is i am unable to got that id feild at runtime when i click on the delete button in perticular row.
regards
yogesh
|
|
|
|
|
use DataKey property of the gridview to access the ID value and to delete a particular record set the Command Property of the Delete Button as "Delete" and use GridView.RowCommand Event and put your delete code there...
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
hello jon thanks for your reply but sorry its not working
i use a gridview then set the datakey property with the name of my primary key feild available in my table, then in row commnad event is used to display the value of datakey with the index it always display 1 as a result. so could you suggess any solution.
regards
yogesh
|
|
|
|
|
Did you set the datakeynames property in the GridView? something like this...
asp:gridview id="GridView1" datasourceid="GridView1Source" <br />
autogeneratecolumns="true" datakeynames="ID" runat="server">
If yes then In the GridView.RowCommand Event you can access the ID value using the below statement
GridView1.DataKeys[rowIndex].Value
try this...
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
Try this:
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
Try
Dim oGridViewRow As GridViewRow
oGridViewRow = CType(CType(e.CommandSource, Control).NamingContainer, GridViewRow)
ID = CInt(GridView1.DataKeys(oGridViewRow.RowIndex).Value)
If e.CommandName = "DeleteTrans" Then
DeleteRecord(ID)'Function for delete the selected record
BindGridView()'Bind Gridview again
End If
Catch ex As Exception
End Try
End Sub
Hope this helps u??
|
|
|
|
|
you have to give a primary key field as datakey field of datagrid.
asp:DataGrid ID="dgrdProducts" DataKeyField="ProductID" OnDeleteCommand="dgrdProducts_DeleteCommand" Runat="Server"
.
.
Then in code file
void dgrdProducts_DeleteCommand( Object sender, DataGridCommandEventArgs e )
{
int intProductID;
intProductID = (int)dgrdProducts.DataKeys[e.Item.ItemIndex];
}
using intProductID you can delete record from database.
Regards,
EbyZ
|
|
|
|
|
I'm using VB.NET and Informix database
I'm trying to get last serial id whenever i perform an insert statement.
Here is what i have so far
Insert into Table1 values (0,"Mouse")
SELECT DBINFO('SQLCA.SQLERRD1') FROM systables WHERE tabname = Table1
My problem is, sometimes i get 0 as the ID although the row has been inserted
Can someone please help
Thanks
Read, Read, Read instead of asking Why, When, Who, and How?????
|
|
|
|
|
hi
i want to save my connection string in web.config . what is best way to encrypt and decrypt connection string ?
can you get me a good reference ?
tanks
|
|
|
|