.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

cross page posting values getting wrong

Posted By:      Posted Date: October 23, 2010    Points: 0   Category :ASP.Net
 

Hi,

I  am doing project in asp.net(3.5),c#.net and sqlserver2005

I am using cross page posting property from reviewsubmit.aspx page to principalauthentication.aspx,

and to get the values to other page i am  using get propery, here the problem is when i am posting details to other page from there i am submitting to db. if both users logged in at a time and   submitted, second submitted user previouspage values coming as first submitted previous

page values. what should i do, how can i resolve


please give me solution.





View Complete Post


More Related Resource Links

ASP.NET Proxy Page - Used for Cross Domain Requests from AJAX and JavaScript

  
The article ASP.NET Proxy Page - Used for Cross Domain Requests from AJAX and JavaScript was added by Aamir Hasan on Thursday, August 19, 2010.

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn't allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull content

update parentpage gridview with the values from child page?

  

hi   i am having a gridview on each row i am having a update and add button.

on click of either of the button i am opening a popup where the end user will enter data and on clck of ok button in the child page

based on the click ie

if i clicked update i need to update that particular row with the values from child page.

if i clicked on add i need to add a row below the row where i clicked add button .

can anyone help me with this?


Retain DropDown,TextBox's previously selected values after redirected from another page.

  

 Hi People, How are you all doing?

I have 2 pages one is SearchPage & It has DropDowns, textboxes to specify the search criteria. From the search result the user is redirected to another page when he clicks the hyperlink in the search result  where he fills in the information and again redirected to SearchPage. Now the SearchPage is posted back with no state i just want to retain the search criteria and display when user comes back. Please give me some suggestion how to get this done. I've used ViewState to save the values and check them in Page_Load but they are null.   

Thanks

Abid

 Update: I've come up with this code. But the problem is The values are being retained but the Button_Click event is not being handled properly. When i Check the code even after this "DropDownList1.SelectedValue = Session["Name"].ToString();" DownList1.SelectedValue is EMPTY"" samw with DropDownList2 . please Suggest something

 

    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsControlsEmpty())
        {
            if (SessionExist())
            {
                DropDownList1.SelectedValue = Session["Name"].ToString()

Control Values When Returning to Page

  

Why do controls value not persist when returning to a page (e.g. via browser back button)?  If I set control values without utilizing a post back the controls will maintain their last value when I return to the page.  If I set a control value and then call a post back, the control value is reset to the default value when returning.


I have many pages with a gridview, and a textbox which is used to filter the gridview contents.  I set the filter textbox, filter the gridview (postback), go to another page, and when I return to the gridview page (via back button), my filter textbox is reset empty, and the gridview is the original (unfiltered) data.


What concept am I missing here?


Thanks in advance...


jQuery modified ListBox not posting back modified values

  

Hi everyone,


I have an ASP.Net ListBox that I'm trying to populate via jQuery, using the following snippet:

        $("#MyList_btnAddAll").click(function(e) {
        e.preventDefault();
        $('#MyList_lstAll option').appendTo('#MyList_lstSelected');
    });

The code has two ListBoxes in fact, one a "source" and the other a "destination".  As you can tell above the ListBoxes are MyList_lstAll and MyList_lstSelected.  These are rendered in the browser as <select> elements, as you'd expect.

The jQuery is working great, the items are moving from one ListBox to the other, the DOM is updated but when I submit this form (not using jQuery), the ListBoxes don't reflect this change on postback. 

I realize my modifications via jQuery aren't available in ViewState but I thought since the DOM was updated these changes would be part of the postback data?  But in the codebehind after postback the ListBox contents haven't changed.  Does anyone know what might be going on and what I can do about it?  Many thanks.


Populate Treeview upon entered criteria and page action without complete page posting on client side

  

1. I have a treeview on left side in a panel in my aspx page and I have a Text box and a Search button on the right panel. On entering a search criteria and clicking the Search button, I want to get the data needed for the treeview (FYI - I have a webservice call for that) and then populate the treeview completely but keep it collapsed to the root node.

  Each time I enter the search criteria and click the Search button, I don't want to post the entire page (and also don't like the page flicker), how can I achieve this? I know that in order to avoid complete postback upon Search button click, I can do so by client callback and get the data needed for the treeview, but in this case, I have to build the treeview nodes as table - row/cells and handle all the events and handlers myself, which I want to avoid (also means that I won't be able to take advantage of the inherent expand and collapse capabilities of the Treeview). On the other hand, if I use the OnTreeNodePopulate event handling of the Treeview control, using the C# script code on the aspx markup, it doesn't recognize the entered criteria in the Text box. So either way,

Return to the wrong web page.

  
Hi, In my web site, I have master page, default.aspx, login.aspx,loggedout.aspx and Display.aspx. default.aspx is the start-up web page. I want to go to display.aspx after I login. However it always go to default.aspx. Here is the code. login.aspx<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %> <asp:Content ID="Content" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:Login ID="Login1" runat="server" onauthenticate="Login1_Authenticate"> </asp:Login> </asp:Content>     login.aspx.csusing System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class Login : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { string userName = Login1.UserName; string password = Login1.Password; bool rememberUserName = L

Passing values from web page to custom security trimmer in SharePoint 2010

  
Hi, In SharePoint 2007 we had a custom security trimmer that implemented ISecurityTrimmer interface. We also had a custom webpart used for search. Now, using HttpContext we passed values from the webpart to security trimmer with additional info needed to trim the results. It worked since trimmer was executed in the same w3wp process as webpart. Now in SharePoint 2010, the architecture for ISecurityTrimmer2 has changed, as it's executed in search process (other w3wp) - not the webpart w3wp so it has no access to the HttpContext. Question is: how to pass custom data, in form of the string, to a security trimmer when search is done from custom code in webart?

Retrieving values from previous page

  
Hey Forumers,Here is the case, I have a datalist displaying a whole list of text files and I have a hyperlink with the title as the text and a navigateUrl that navigates the user to a page to display the file the user chose.I have coded the hyperlink like so:<asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Eval("Title") %>' NavigateUrl='<%# Eval("StoryID", "StoryDisplay.aspx?StoryID={0}") %>'>Hyperlink</asp:HyperLink>The problem I am facing is that I got this code snippet from another source and I don't know what does the StoryID={0} means. I do know that the eval statement would sent the storyID of the selected file to StoryDisplay.aspx, I just don't know how to retrieve the values from the second page.P.S. the second page contains a title label and an area(enclosed in <div> tags) for the selected text to be displayed.Please help and thanks in advance =)Cheers,Zephere

Log in givin wrong destination page

  
I have a log in control that has this set in the aspx:      DestinationPageUrl="~/Admin/Articles/ListArticles.aspx"      DestinationPageUrl="~/Admin/Articles/ListArticles.aspx" This works well when i log in. But when i log out and im returned to the log in page the url shows:Finlandsinstitutet/login.aspx?ReturnUrl=/Finlandsinstitutet/Admin/Articles/Default.Aspxand since there is no default.aspx in the articles folder i cannot log in again!Why is this?

Get Control that triggered cross page postback

  
Hi I want to know if there is a way to get the control that triggered the postback,such as I have one page Page1.aspx with two buttons like<asp:Button id="btnCrossPost" runat="server" Text="Post To Another Page" PostBackUrl="Page2.aspx" CommandArgument="1"/><asp:Button id="btnCrossPost2" runat="server" Text="Post To Another Page 2" PostBackUrl="Page2.aspx" CommandArgument="2"/>and in Page2.aspx I want to get which button triggered the post back so that I can get the command argument which is vitalto the processing of the next page.Thanks.

Transfer values from one page to another Request Object

  

Asslam-o-Alaikum

I wanTransfer values from one page to another using Request Object

but when i try store

textBox value into Request object like..

Request["Name"] = txtName.Text;

i get the following Error

Property or indexer 'System.Web.HttpRequest.this[string]' cannot be assigned to -- it is read only

Is Request object allows us to store values init like Session & Application Object............


Transfer values from one page to another Request Object

  

Asslam-o-Alaikum

I want to Transfer values from one page to another using Request Object

but when i try store

textBox value into Request object like..

Request["Name"] = txtName.Text;

i get the following Error

Property or indexer 'System.Web.HttpRequest.this[string]' cannot be assigned to -- it is read only

Is Request object allows us to store values init like Session & Application Object............
Taha Zubair Ahmed Software Emgineer.

Asp.net Cross Page Post Back issue

  

Dear All,

I have two web pages, say SourceWebPage and TargetWebPage, on the TargetWebpage I have a directive like:
&lt;%@ PreviousPageType VirtualPath = "~/SourceWebPage.aspx" %&gt;

These are the code behand on TargetWebPage Page_Load Event:

if (!Page.IsPostBack)
            {
                if (Page.PreviousPage != null &amp;&amp; Page.PreviousPage.IsCrossPagePostBack)
                {
                    DateTime reportDate = PreviousPage.DTReportDate;
                    string serialNo = PreviousPage.SerialNo;
                }
                else
                {
                 

Viewing original blog posting from search page

  
I have an installation of WSS 3.0 with a blog.  When users search in the blog, results are returned as expected on the search page with one line containing the search phrase.  However when they click on a result they are taken to a Comments page for the posting and can't see the text of the original post which is generally the reason for the search.  The link on the search hit (ex: http://server1:8000/thelog/Lists/Posts/ViewPost.aspx?ID=232) does the same thing.  How can they access the original text of a blog posting from a search or how can the original text be included on the Comments page?  Thanks!

ASP MVC2: wrong render of the model after posting

  

I have faced with some strange behavior and I hope you will be able to tell, what I do wrong.

My goal is to change the order of some object. This object has property Priority which defines the order. Objects render as a list and user can drag elements for prepare order. When user click save, JS code modifies Priority property in hidden fields in accordance with order of elements in the list. And this form is sent to the server.

My goal is to change the order of some object. This object has property Priority which defines the order. Objects render as a list and user can drag elements for prepare order. When user click save, JS code modifies Priority property in hidden fields in accordance with order of elements in the list. And this form is sent to the server.

Action get method in the controller:

[HttpGet]
public ActionResult EditPriority()
{
    return View(_missionRepository.OrderBy(mission => mission.Priority).ToList());
}

Action post method:

 [HttpPost]
      

load new page and populate the values without database

  

hi,

I'm creating a website of 5 pages using c# (asp.net).

How do i link 2 pages, ie., on click of a button on first page should take me to second page.

Advance thanks,

neo


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend