|
I am really sorry that I checked the same when I remove the update panel and checked it in pure postback. But When I use the update panel it's firing but not populating. The dataset containst the data also. I checked it in Immediate Window and got the result. Any idea on this. Sorry for giving you the wrong information earlier.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi guys i am facing probs in session clear...,
In my login page i am checking, one value if its empty then i am killing the session using :
Session.Abondon();
If i use like this whenever i am logout my session are getting clear and in the same page if i once again login its redirecting to my login page only...,
in my second time login only i can able to enter my page...,
Instead of session.abondon if i clear the session like:
Session.Remove="";
After logout i can able to enter my login page in first time itself...,
whats the probs for using session.abondon();
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
Session.Abandon() , Cancels the current session , Means The Abandon method destroys all of the session objects and releases their resources for that user.
If you check the session variable after that you will get Null object.
<br />
Session.Remove(strSessionName) , Remove an Item from Session State Collection . So Its only remove that particular item that you have mention on strSessionName .
Now about your problem,
Use Session.Abandon() at the time of Logoff. It will clear session data and destroy the objects , and While checking first time in login , check session variable first , if its null, redirect user to login page again
And If you are more interested on session just read Exploring Session in ASP.Net[^]
|
|
|
|
|
Member 3879881 wrote: whats the probs for using session.abondon();
You need to implement void Session_End(object sender, EventArgs e) of Global.asax
void Session_End(object sender, EventArgs e)
{
Session["varName"] = null;
}
|
|
|
|
|
i want to set the focus at the end of textbox on page refresh.
i am using timer control to refresh my page.
so when page get refresh the cusor should be at the end of textbox
|
|
|
|
|
dilip514 wrote: so when page get refresh the cusor should be at the end of textbox
You want to mean you have some text on textbox and focus will be end of that text ? please confirm .
|
|
|
|
|
How to transfer datas from one folder to another folder using ASp.net coding.pls help me with this,
thanks
Regards Arun..
|
|
|
|
|
Get the directory contents using Directory.GetFiles() . Iterate the collection and copy file one by one. You need to write a recursive search which will copy the subdirectories as well.
|
|
|
|
|
Have a look here. Copy file from one Dir to another[^]
This is vb.net code , hope you will get an idea how to implement in C#
ArunRevathy wrote: Subject: help me
Never put subject line like that . Always give proper subject, it will help you to get answer
|
|
|
|
|
Well, if the folders are on the server, it's trivial, and if they are on the client ( as I suspect you mean from the over all clueless air of your post ). it's not possible, buy a book, learn what ASP.NET, etc.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi everyone,
In my application I am trying to get the response from authorize .net ,if i am using http webresponse i am able to the respons from site like approved or failed etc but if i mention x_relay_url(return url is the page to where authorize .net will send the response) ,it is not able to come back to the page. I am using https://test.authorize.net/gateway/transact.dll for demo purpose, when i am submitting my transaction it is remaining in the same page(https://test.authorize.net/gateway/transact.dll) and giving message as
"An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card."
This transaction has been approved.
It is advisable for you to contact the merchant to verify that you will receive the product or service.
So i am not able to get the reponse in my site only
pls can anybody help me its very urgent
|
|
|
|
|
Contact the authorize.net support people.
|
|
|
|
|
I have a gridview that is being dynamically populated with data based on textbox values at runtime. The code inside the button click is as follows:-
1 conn.Open();
2 string strSQL = "SELECT [UserId], [IsLockedOut] FROM [ac_Users] WHERE ([UserId] =" + Int32.Parse(tb_UserID.Text) + ")";
3 SqlCommand cmd = new SqlCommand(strSQL, conn);
4 DataTable dt = new DataTable();
5 SqlDataAdapter sqlAdapter = new SqlDataAdapter(null, conn);
6 sqlAdapter.SelectCommand = cmd;
7 sqlAdapter.Fill(dt);
8 conn.Close();
9 try
10 {
11 grd_Users.DataSource = dt.DefaultView;
12 grd_Users.DataBind();
13 pnl_Users.Visible = true;
14 }
15 catch (Exception ex)
16 {
17 TestUtils2.TestLogger.WriteErrorEntry(ex.Message, AuctivaUtils2.eAuctivaLogFile.General);
18 }
19 finally
20 {
21 conn.Close();
22 }
The gridview is correctly populated with the data I need, however I want each row in the data that is returned to be editable. I have the AutoGenerateEditButton property set to true and have also set the DataKeys property of the the gridview with the primary key of the table being returned.
However when I click the 'edit" link that appears in each row in the gridview, nothing happens. How do I make that button make the corresponding row editable ?
|
|
|
|
|
You should probably drop the line numbers and wrap your code in <pre></pre>...makes it easier to read. As for why edit doesn't work...I'd need to know more. Are you using an UpdatePanel/AJAX? How much data is bing bound? A few rows, or thousands? Volume can affect the performance of actions like edit sometimes.
|
|
|
|
|
I am not using any AJAX. the data being returned is not more than 10 rows.
|
|
|
|
|
Hi
I am creating a custom sever control. I have property with name selected color i wana bound this property with Color editor. So user can select color in color window any who can help me.
Thanks
Vicky
|
|
|
|
|
In design time correct? If you use Color[^] structure, the IDE will show color picker.
|
|
|
|
|
I would like to load pages according to the value selected within a list, for example:
<code>
protected void Button2_Click(object sender, EventArgs e)
{
if (lstTaskCategory.Text.Equals("User Experience")) {
//Load Task_entry_2_user_experience.aspx
}
else if (lstTaskCategory.Text.Equals("Localization")) {
//Load Task_entry_2_localization.aspx
}
else if (lstTaskCategory.Text.Equals("Documentation") {
//Load Task_entry_2_documentation.aspx
}
}
</code>
More questions...
Is it also possible to do the above as a dynamic hyperlink (i.e. have a hyperlink that automatically updates a value within
<a href="page.aspx"> Next </a>.
In my case the value of <page.aspx> would change according to the value in lst.TaskCategory.Text.
Jon
|
|
|
|
|
Well, for starters you could use a switch statement. If it's a list, you could also use the data field to store the URLs.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
A switch statement will do the job as well, however I'm not sure what command to execute, would you have a code sample?
Jon
|
|
|
|
|
Oh, you're looking for Response.Redirect ? I suggest you buy an ASP.NET book to help you with the basics, or you'll find you'll spend a lot of time posting here and waiting for answers when you could be making progress.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks. I had been scouting the web and books, but I must have skipped this part
"Blonde moment"
Jon
|
|
|
|
|
Hi guys I am getting this wird error message
An invalid character was found in text content. Error processing resource 'http://localhost/myweb/source/a2.aspx...
if i take out the Response.ContentType then i am able to view the image but i don't comment then error message shows up.
string filePath = Request.QueryString["FILEPATH"];
Response.ContentType = "image/jpg";
Response.BinaryWrite(System.IO.File.ReadAllBytes(filePath));
Thanks
|
|
|
|
|
Try using a mime type that actually exists: "image/jpeg".
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
i have a grid view on which i m doing insert ,delete,edit operations.
i have created stored procedures for them in sql server 2005.
i created buttons for edit and delete in each row of gridview.
i am only using "rowcommand" event for editing and deleting operation.
on edit button click i want to insert cell values of row into textboxes in my webform outside gridview.
i have edit button outside on clicking which it enters textbox value in grid view..
HOW CAN I ACHIEVE THIS?
source code:-
@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="gvEmployee" DataKeyNames="PKemployeeID" runat="server" Style="z-index: 100;
left: 112px; position: absolute; top: 271px" Width="472px" OnSelectedIndexChanged="gvEmployee_SelectedIndexChanged" Height="46px" AutoGenerateColumns="False" OnRowCommand="gvEmployee_RowCommand">
<Columns>
<asp:BoundField DataField="FirstName" HeaderText="Fitst Name" />
<asp:BoundField DataField="LastName" HeaderText="Last Name" />
<asp:BoundField DataField="EmployeeID" HeaderText="Employee Id" />
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="Button1" runat="server" CausesValidation="false" CommandName="EDIT" CommandArgument='<%# Bind("PKemployeeID") %>'
Text="Edit" />
</ItemTemplate>
</asp:TemplateField>
<asp:ButtonField ButtonType="Button" Text="Delete" CommandName="DELETE" />
</Columns>
</asp:GridView>
</div>
<asp:Label ID="Label1" runat="server" Style="z-index: 101; left: 233px; position: absolute;
top: 36px" Text="First Name "></asp:Label>
<asp:TextBox ID="txtEmpId" runat="server" Style="z-index: 102; left: 353px; position: absolute;
top: 158px"></asp:TextBox>
<asp:TextBox ID="txtFirstName" runat="server" Style="z-index: 103; left: 354px; position: absolute;
top: 35px"></asp:TextBox>
<asp:TextBox ID="txtlastname" runat="server" Style="z-index: 104; left: 354px; position: absolute;
top: 91px"></asp:TextBox>
<asp:Label ID="Label2" runat="server" Style="z-index: 105; left: 232px; position: absolute;
top: 159px" Text="EmployeeID"></asp:Label>
<asp:Label ID="Label3" runat="server" Style="z-index: 106; left: 233px; position: absolute;
top: 94px" Text="Last Name"></asp:Label>
<
<asp:Button ID="btnAdd" runat="server" Style="z-index: 109; left: 259px; position: absolute;
top: 214px" Text="Add" Width="88px" OnClick="btnAdd_Click"
/>
</form>
</body>
</html>
aspx.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
{
protected void Page_Load(object sender, EventArgs e)
{
string connectionString = (string)ConfigurationManager.AppSettings["ConnectionString"];
SqlConnection sqlconn = new SqlConnection(connectionString);
SqlCommand sqlCommand = new SqlCommand("GetemployeeDetails",sqlconn);
sqlCommand.CommandType = CommandType.StoredProcedure;
DataSet ds = new DataSet();
SqlDataAdapter ada = new SqlDataAdapter(sqlCommand);
ada.Fill(ds);
gvEmployee.DataSource = ds;
gvEmployee.DataBind();
}
protected void gvEmployee_SelectedIndexChanged(object sender, EventArgs e)
{
int index = gvEmployee.SelectedIndex;
}
protected void btnAdd_Click(object sender, EventArgs e)
{
string connectionString = (string)ConfigurationManager.AppSettings["ConnectionString"];
SqlConnection sqlconn = new SqlConnection(connectionString);
SqlCommand cmd = new SqlCommand("insertemployee", sqlconn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@FirstName", txtFirstName.Text);
cmd.Parameters.AddWithValue("@LastName", txtlastname.Text);
cmd.Parameters.AddWithValue("@EmployeeID", txtEmpId.Text);
cmd.Connection.Open();
cmd.ExecuteNonQuery();
cmd.Connection.Close();
}
protected void gvEmployee_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "EDIT")
{
int intPkId = Convert.ToInt32(e.CommandArgument);
/* i dont know what to put here */
//LinkButton btnEdit = e.CommandSource as LinkButton;
//GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
//int index = Convert.ToInt32(gvEmployee.DataKeys[row.RowIndex].Value);
//txtFirstName.Text = row.Cells[1].Text.ToString();
}
}
}
mihirkul vikram
|
|
|
|