Updatepanel not working with custom master page in sharepoint 2013 - updatepanel

I have created a sample update panel in visual webpart in sharepoint 2013. this code is working with default master page (seatle) but when i applies custom master page it would not work.
<div>
<br />
<asp:UpdatePanel ID="upSetSession" runat="server">
<ContentTemplate>
Current Time:
<asp:Label ID="lblTime" runat="server"></asp:Label><br />
<asp:DropDownList ID="ddlMyList" runat="server" OnSelectedIndexChanged="ddlMyList_SelectedIndexChanged"
AutoPostBack="true">
<asp:ListItem>Select One</asp:ListItem>
<asp:ListItem>Maybe</asp:ListItem>
<asp:ListItem>Yes</asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlMyList" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</div>
and code behind is :
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ddlMyList_SelectedIndexChanged(object sender, EventArgs e)
{
lblTime.Text = DateTime.Now.Second.ToString();
}
I had already checked scriptmanager tag and webpart manager inside the sharepointform tag in custom master page.

Finally I got the answer. I have to use some script like
<script type='text/javascript'>
_spOriginalFormAction = document.forms[0].action;
_spSuppressFormOnSubmitWrapper=true;
</script>
Reference

Related

html form post to an aspx page, the header fields are not being posted. Chrome says the request is a GET, and does not show Form Data at all

Here is the posting page:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Properties login</title>
</head>
<body>
<form id="formstart" method="POST" action="proplist.aspx">
<table id="loginTable" class="center">
<tr>
<td><label >User name</label></td>
<td><input type="text" name="usertext" text="asm"/></td>
</tr>
<tr>
<td><label ID="passwd" >Password</label></td>
<td><input type="text" name="passtext" text=""/></td>
</tr>
<tr>
<td><label ID="Label2" >Press to continue</label></td>
<td><input type="submit" value="Submit" /></td>
</tr>
</table>
</form>
</body>
</html>
Simple html, no asp in case that causes any problem.
Here is the target aspx page:
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="proplist.aspx.cs" Inherits="PropertyW.proplist" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="formlist" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Names="Comic Sans MS" Font-Size="Larger" ForeColor="#3333CC" Text="Property List"></asp:Label>
<div id="loginResponse" runat="server" >not logged in
</div>
<div id="namePassed" runat="server"></div>
</form>
</body>
</html>
Here is the code behind.
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace PropertyW
{
public partial class proplist : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
NameValueCollection nvc = Request.Form;
string userName = "asm", password = "17kgrovE";
string sName = Request.Form["usertext"];
string sPass = nvc["passtext"];
if (nvc.Count > 0)
{
sName = nvc["usertext"] + ".nvc";
}
string sMsg = string.Format("name passed = {0}, nvc count = {1}", sName, nvc.Count);
namePassed.InnerHtml = sMsg;
if (!string.IsNullOrEmpty(sName))
{
userName = sName;
}
if (!string.IsNullOrEmpty(sPass))
{
password = sPass;
}
// CheckLogin(userName, password);
}
}
}
}
Here is what chrome shows in the network tab. There is no entry for the Form data.
In the code behind the form fields are null. (usertext and passtext).
Chrome shows the request as a GET even though the code is a POST.
Here is what chrome shows in the network tab.

SSRS report server Data issue

I have deployed SSRS report on Production environment. When 3 or more user run the same report on production then report server load other user requested data.
For Example-
Below 3 request-
User A requested Report X with Paremeter A
User B requested Report X with Paremeter B
User C requested Report X with Paremeter C
Output from SSRS server -
User A requested Report X with Paremeter A
User B requested Report X with Paremeter A
User C requested Report X with Paremeter C
Note- This problem occur when all the users request report in same time.
We had same issue, if you are using ReportViewerForMVC from NuGet Package manager which is third party control may cause problem, follow below points
we will re-use code from ReportViewerForMvc and modify as per our need
1
Install-package ReportViewerForMvc and press enter. After few minutes the package will be installed
2
This installation will add to the project: 2 assemblies (Microsoft.ReportViewer.WebForms & ReportViewerForMvc)to references an .aspx page (ReportViewerWebForm.aspx) and httphandlers settings in the web.config file.
Note: the .aspx page added does not have a .cs file.
You can now use this .aspx page and code everything in controller, but I am using a slightly different path for code reusability and consistency)
Add a new folder ‘Reports” to the project, and then add a new webform .aspx page (ReportTemplate.aspx to the Reports folder
3
Copy the contents (as shown in fig) from ReportViewerWebForm.aspx and replace the content of ReportTemplate.aspx with this.
Note: Please do not copy #page directive, copy only the highlighted section.
4
<%# Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<%--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">--%>
<!doctype html>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE11">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="scriptManagerReport" runat="server">
</asp:ScriptManager>
<rsweb:ReportViewer runat ="server" ShowPrintButton="false" Width="99.9%" Height="100%" AsyncRendering="true" ZoomMode="Percent" KeepSessionAlive="true" id="rvSiteMapping" SizeToReportContent="false" >
</rsweb:ReportViewer>
</div>
</form>
</body>
</html>
5
The ReportTemplate.aspx will change to this
6
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="ReportTemplate.aspx.cs" Inherits="ASPNETMVC_SSRS_Demo.Reports.ReportTemplate" %>
<%# Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<%--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">--%>
<!doctype html>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE11">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="scriptManagerReport" runat="server">
<Scripts>
<asp:ScriptReference Assembly="ReportViewerForMvc" Name="ReportViewerForMvc.Scripts.PostMessage.js" />
</Scripts>
</asp:ScriptManager>
<rsweb:ReportViewer runat ="server" ShowPrintButton="false" Width="99.9%" Height="100%" AsyncRendering="true" ZoomMode="Percent" KeepSessionAlive="true" id="rvSiteMapping" SizeToReportContent="false" >
</rsweb:ReportViewer>
</div>
</form>
</body>
</html>
7
Next delete the below scripts tag from ReportTemplate.aspx page
<Scripts>
<asp:ScriptReference Assembly="ReportViewerForMvc" Name="ReportViewerForMvc.Scripts.PostMessage.js" />
</Scripts>
8
Add additional attributes to the ReportViewercontrol as below
<rsweb:ReportViewer id="rvSiteMapping"runat ="server"ShowPrintButton="false"Width="99.9%"Height="100%"AsyncRendering="true"ZoomMode="Percent"KeepSessionAlive="true"SizeToReportContent="false"></rsweb:ReportViewer>
9
Now open ReportTemplate.aspx.cs file and add below code to the Page_load event, you need to the SSRS Server URL and SSRS report Folder path.
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ASPNETMVC_SSRS_Demo.Reports
{
public partial class ReportTemplate : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
try
{
String reportFolder = System.Configuration.ConfigurationManager
.AppSettings["SSRSReportsFolder"].ToString();
rvSiteMapping.Height =
Unit.Pixel(Convert.ToInt32(Request["Height"]) - 58);
rvSiteMapping.ProcessingMode =
Microsoft.Reporting.WebForms.ProcessingMode.Remote;
rvSiteMapping.ServerReport.ReportServerUrl = new Uri("SSRS
URL"); // Add the Reporting Server URL
rvSiteMapping.ServerReport.ReportPath =
String.Format("/{0}/{1}", reportFolder, Request["ReportName"].ToString());
rvSiteMapping.ServerReport.Refresh();
}
catch (Exception ex)
{
}
}
}
}
}
10
Add the SSRSReportFolder path to the app settings in the web.config file.
<add key="SSRSReportsFolder" value="BIC_Reports"/>
11
Next, create an entity class ReportInfo.cs under Models folder
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace ASPNETMVC_SSRS_Demo.Models
{
public class ReportInfo
{
public int ReportId { get; set; }
public string ReportName { get; set; }
public string ReportDescription { get; set; }
public string ReportURL { get; set; }
public int Width { get; set; }
public int Height { get; set; }
public string ReportSummary { get; set; }
}
}
12
Next, we will add code to the Controller and the View Pages. There is no
change to the HomeController.cs. Add the following code to Home/Index view
page.
#{
ViewBag.Title = "Index";
}
<h2>Reports List</h2>
<a id="ReportUrl_Performance" href="#Url.Action("ReportTemplate", "Report", new { ReportName = "Performance", ReportDescription = "Performance Report", Width = 100, Height = 650 })">
Performance Report</a>
13 Next
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ASPNETMVC_SSRS_Demo.Models;
namespace ASPNETMVC_SSRS_Demo.Controllers
{
public class ReportController : Controller
{
//
// GET: /Report/
public ActionResult ReportTemplate(string ReportName, string
ReportDescription, int Width, int Height)
{
var rptInfo = new ReportInfo
{
ReportName = ReportName,
ReportDescription = ReportDescription,
ReportURL = String.Format("../../Reports/ReportTemplate.aspx?
ReportName={0}&Height={1}", ReportName, Height),
Width = Width,
Height = Height
};
return View(rptInfo);
}
}
}
14
Final Step is to open the ReportTemplate view page under Report and add the following code.
#model ASPNETMVC_SSRS_Demo.Models.ReportInfo
<H1>
#Model.ReportDescription
</H1>
<iframe id="frmReport" src="#Model.ReportURL" frameborder="0" style="#String.Format("width:{0}%; height: {1}px;", Model.Width, Model.Height)" scrolling="no">
</iframe>

Read data from a text box in asp.net and display it in another web page

I am new to ASP.net . I am trying to work with basic web forms.
I created code to take first name and last name from user. When user clicks on submit, I need the data to be displayed on another page. Can someone make the code for me that should be written on the output web page?
My Code is :
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>My First web page</title>
</head>
<body>
<form id="form1" runat="server" action="WebFormOutput.aspx" >
<div style="position:absolute">
<input type="text" name="txtFirstName" placeholder="Enter Your First Name" />
<input type="text" name="txtLastName" placeholder="Enter Your Last Name"/>
<input id="Submit1" type="submit" value="submit" />
</div>
</form>
</body>
</html>
Thank You
consider the following example...
1.Create a web page named default.aspx(say)like following,
<%# Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="HP_Master_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:Label ID="Label1" runat="server" Text="First Name"></asp:Label>
<asp:TextBox ID="txtFN" runat="server"></asp:TextBox>
<asp:Label ID="Label2" runat="server" Text="Last Name"></asp:Label>
<asp:TextBox ID="txtLN" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="SUBMIT" onclick="Button1_Click" />
</div>
</form>
</body>
</html>
and in Default.aspx.cs,like following
using 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 HP_Master_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Session["FN"] = txtFN.Text;
Session["LN"] = txtLN.Text;
Response.Redirect("Default2.aspx");
}
}
what i have done is
1.Created a page,and added server controls from tool bar,Label1,Label2,txtFN,txtLN, and a Button
2.Added onclick event to button,and in code behind created two sessions to carry the values entered in the two text boxes,Session["FN"],and Session["LN"],then the page is redirected to another page "Default2.aspx" on button click
3.Default two cantains two server controls LblFN,andlblLN that contain no values initially
4.When the page is loaded as soon as the button in previous page is clicked,in the current pages page load event,the text property of labels lblFN,and lblLN are set with the values stored in the Session variables.the code for this is as per following
default2.aspx:
<%# Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="HP_Master_Default2" %>
<!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:Label ID="lblFN" runat="server" Text=""></asp:Label>
<asp:Label ID="lblLN" runat="server" Text=""></asp:Label>
</div>
</form>
</body>
</html>
default2.aspx.cs:
using 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 HP_Master_Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
lblFN.Text = Session["FN"].ToString();
lblLN.Text = Session["LN"].ToString();
}
}

I can't get JSignature canvas data in code behind from hidden field

I'm using jSignature to capture the users signature, after that I would like to put it into a database, I have the signature panel showing and when I send the data into an alert box I can see it, also I have a asp.net hidden field in the page were I'm storing the data, the problem is that I can't get the data into my code behind so I can store it in the database.
<telerik:RadCodeBlock runat="server">
<script src="../Scripts/JSignature/jquery-1.9.0.min.js"></script>
<script src="../Scripts/JSignature/jSignature.min.js"></script>
<script type="text/javascript">
function SaveCanvasImage() {
var image = $('#signature').jSignature('getData', 'base30');
var hdnField = $('#<%= hdnSignature.ClientID %>');
$('#<%=btnHidden.ClientID %>').click();
return false;
}
</script>
<script>
function pageLoad() {
InitSignaturePanel(); //this is a function in a global js file.
}
</script>
</telerik:RadCodeBlock>
<!--[if lt IE 9]>
<script type="text/javascript" src="../Scripts/JSignature/flashcanvas.js"></script>
<![endif]-->
<telerik:RadScriptManager runat="server"></telerik:RadScriptManager>
<div class="width400">
<telerik:RadAjaxPanel runat="server"> <asp:Label runat="server" ID="lblHidden" />
<asp:HiddenField runat="server" ID="hdnSignature" />
<div id="signature" class="trueMargin signaturePanel"></div>
</telerik:RadAjaxPanel>
<div class="textAlignCenter">
<br />
<input type="button" id="clearCanvas" value="Reset" onclick="$('#signature').jSignature('clear')" />
<asp:Button id="btnCaptureCanvas" runat="server" Text="Save and Close" OnClientClick="SaveCanvasImage()" />
<asp:Button runat="server" ID="btnHidden" OnClick="btnHidden_Click" />
</div>
</div>
And in the code behind I have:
protected void btnHidden_Click(object sender, EventArgs e)
{
lblHidden.Text = hdnSignature.Value;
}
Suspect this happens because you actually don't put the signature into the hidden field.
I think you mean to have this:
function SaveCanvasImage() {
var image = $('#signature').jSignature('getData', 'base30');
var hdnField = $('#<%= hdnSignature.ClientID %>').val('data:' + image.join(',')); // <-- note the addition
$('#<%=btnHidden.ClientID %>').click(); // <- what is this for by the way?
return false;
}

problem with jqmodal inside an update panel

I have a control that I need to display as a page or as a modal dialog.
In the page_load event I look to see if the modal property is set and if so, I register a script to invoke jqmodal. Here is the code:
protected void Page_Load(object sender, EventArgs e)
{
if (this.Modal) // Show as a modal dialog
{
selector.Attributes.Add("class", "jqmWindow");
selector.Attributes.Add("style", "width:1100px;height:600px;");
string script = "<script type=\"text/javascript\">$().ready(function() { $(" + "'#" + selector.ClientID + "').jqm({ modal: true }).jqmShow();});</script>";
//script = "<script type=\"text/javascript\">confirm('hello');</script>";
ScriptManager.RegisterStartupScript(this,this.GetType(),"duh",script,false);
}
}
This control is used on a page that has an update panel.
This all works well in Firefox and IE for the INITAL page load and any refreshes. However when I postback I get problems in IE and FF:
In IE, the div that represents the modal (in this case, selector) is shifted down and to the right about 500 px.
In firefox, the darkened area around the div becomes progressively darker with each postback.
If I remove the update panel from the host page (it's actually in the master page) this code works.
I have tried not executing the above code on postback but that simply disables jqmodal. I'm really stumped If anyone can help with this I would appreciate it.
The problem is that on PostBack, the jQuery div is moved down and to the right. The div after page load looks like this (renders correctly):
DIV class="jqmWindow jqmID1" id=selector style="DISPLAY: block; Z-INDEX: 3000; WIDTH: 1100px; HEIGHT: 600px" _jqm="1" jQuery1238701349279="3">
After Async PostBack it looks like this (renders incorrectly):
DIV class="jqmWindow jqmID2" id=selector style="DISPLAY: block; Z-INDEX: 3000; WIDTH: 1100px; TOP: 146px; HEIGHT: 600px" _jqm="2" jQuery1238701490978="5">
Removing the update panel solves this problem......I don't know that it is the problem.
I created a project with some pages with the just relevent code. The pages are site.master, List.aspx/cs and PartSelector.ascx/cs
// site.master - nothing in codebehind
<%# Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="Site" %>
<!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">
<script src="http://localhost/Scripts/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="http://localhost/Scripts/jqueryUI/ui/ui.core.js" type="text/javascript"></script>
<title></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" > </asp:ScriptManager>
<div>
<asp:updatepanel id="upmaincontent" runat="server" updatemode="conditional">
<contenttemplate>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"></asp:ContentPlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
// list.aspx
<%# Page Language="C#" MasterPageFile="~/Site.master" CodeFile="List.aspx.cs" Inherits="List" Title="Parts Master List" %>
<%# Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Web.UI.WebControls" tagprefix="asp" %>
<%# Register Src="~/Controls/PartSelector.ascx" TagName="PartSelector" TagPrefix="sam" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server" />
<center>
<div><center><h3><%= "Part Selector" %></h3></center></div>
<div>
<center>
<sam:PartSelector ID="PartSelector1" runat="server" Modal="true" ActiveOnly="false" />
</center>
</div>
</center>
</asp:Content>
// list.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Linq;
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.Xml.Linq;
using System.Web.DynamicData;
using System.Linq.Expressions;
public partial class List : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
PartSelector1.ActivateSelector("");
}
}
}
// PartSelector.ascx
<%# Control Language="C#" AutoEventWireup="true" CodeFile="PartSelector.ascx.cs" Inherits="PartSelector" %>
<link href="http://localhost/Scripts/jqModal/jqModal.css" rel="stylesheet" type="text/css" />
<script src="http://localhost/Scripts/jqModal/jqModal.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
var IsModal = false; // Initialize a variable to indicate if the page is to be displayed inside a jqModal dialaog
$().ready(function() { displayPage(); }); // Execute dispalyPage when the dom is ready
function displayPage() {
confirm('displaypage');
IsModal = <%= this.Modal ? "true" : "false" %> // Set IsModal based on a property in codebehind
if(IsModal)
{
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(displayPageAsync); // handle async postbacks
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequestHandler); // clean up before starting an async postback
$("#selector").addClass("jqmWindow"); // add some css to resize the display to fit the modal dialog
$("#selector").css({width:"1100px", height: "600px"});
$("#selector").jqm({ modal: true, onHide: hidejqm }).jqmShow();
}
}
function displayPageAsync(sender, args)
{
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm.get_isInAsyncPostBack() ) { // Prevent displayPage from being called twice on the initial page load
confirm('page loaded, async postback.');
displayPage();
}
}
function beginRequestHandler(sender, args) {
confirm('begin async postback');
$("#selector").jqmHide(); // Hide a dialog from last postback
}
function hidejqm(hash) {
confirm('hidejqm');
hash.w.fadeOut('2000', function() { hash.o.remove(); });
}
</script>
<div id="selector">
<center>
<asp:LinkButton ID="LinkButton1" runat="server" Text="Click here to postback" OnClick="Postback_Click"></asp:LinkButton><br /><br />
<asp:LinkButton ID="CancelButton" runat="server" Text="Cancel" OnClick="CancelButton_Click" CssClass="CommandButton"></asp:LinkButton>
</center>
</div>
// PartSelector.ascx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Linq.Expressions;
public partial class PartSelector : System.Web.UI.UserControl
{
public bool Modal { get; set; }
public void ActivateSelector(string searchString)
{
this.Visible = true;
}
protected void CancelButton_Click(object sender, EventArgs e)
{
this.Visible = false;
}
protected void Postback_Click(object sender, EventArgs e)
{
int x = 1;
}
}