public AjaxControlToolkit.CascadingDropDownNameValue[] GetDropDownContainerValues(string knownCategoryValues, string category) { StringDictionary knownCategoryValuesDictionary = AjaxControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues); int CMSControlID = 0; int.TryParse(knownCategoryValuesDictionary["CMSControls"], out CMSControlID); List<AjaxControlToolkit.CascadingDropDownNameValue> cascadingList = new List<AjaxControlToolkit.CascadingDropDownNameValue>(); CMSControl cmsControl = CMSControlManager.GetCMSControl(CMSControlID); if (cmsControl != null) { try { System.Web.UI.Page page = new System.Web.UI.Page(); CMSUserControlBase userControl = page.LoadControl(cmsControl.UserControlPath) as CMSUserControlBase; if (userControl != null) { Dictionary<string, string> itemsControl = userControl.GetContainerValue(cmsControl.ModuleID, CMSContext.PortalID, CMSContext.LanguageID); foreach (KeyValuePair<string, string> itemControl in itemsControl) { cascadingList.Add(new AjaxControlToolkit.CascadingDropDownNameValue(itemControl.Value, itemControl.Key)); } } } catch (Exception ex) { cascadingList.Add(new AjaxControlToolkit.CascadingDropDownNameValue(ex.Message, "0")); } } return cascadingList.ToArray(); }
protected PageStatePersister(System.Web.UI.Page page) { if (page == null) { throw new ArgumentNullException("page", System.Web.SR.GetString("PageStatePersister_PageCannotBeNull")); } this._page = page; }
public Controller(FI.BusinessObjects.OlapReport Report , System.Web.UI.Page Page) { if(Report==null) throw new NullReferenceException(); _report=Report; _page=Page; }
public DHTML(System.Web.UI.Page page) { gPage = page; gPros = new List<DHTMLProperty>(); //初始化ID设定 gPros.Add(new DHTMLProperty("id")); gnIDIndex = GetPropertyIndex("id"); }
public SynchronizeSessionID(System.Web.UI.Page _page) { if (_page == null) { throw new Exception("SynchronizeSessionID 类需要一个实例化的 System.Web.UI.Page 类型参数。"); } page = _page; }
// ------------------------------------------------------------------ /// <summary> /// Constructor. /// </summary> public QueryStringUtil() { if ( HttpContext.Current!=null && HttpContext.Current.Handler!=null && HttpContext.Current.Handler is System.Web.UI.Page ) { InternalCurrentPage = HttpContext.Current.Handler as System.Web.UI.Page; FromUrl( InternalCurrentPage ); } }
/// <param name="filePath">XML file path</param> /// <param name="loginUserRole">Role as string</param> /// <param name="menuType">Menu drop down orientation</param> /// <param name="title">Title in case of Verticale orientation</param> public UtilMenu(string menuUlID, System.Web.UI.Page page, string filePath, string loginUserRole, MenuTypes orientation = MenuTypes.Horizontal, string title = "", Dictionary<string, bool> permissions = null) { _menuUlID = menuUlID; _page = page; _loginUserRole = loginUserRole; _permissions = permissions; _doc = XDocument.Load(filePath); _eles = from e in _doc.Elements("menu").Elements("menuitem") select e; _menuType = orientation; _title = title; }
public Page() { request = HttpContext.Current.Request; response = HttpContext.Current.Response; qs = request.QueryString; post = request.Form; db = qs["db"]; tbl = qs["tbl"]; session = HttpContext.Current.Session; page = HttpContext.Current.Handler as System.Web.UI.Page; url = request.ServerVariables["URL"]; url = url.Substring(url.LastIndexOf('/'), url.Length - url.LastIndexOf('/')).ToLower(); }
public ContextHelper(ViewContext viewContext) { Requires.NotNull("viewContext", viewContext); var controller = viewContext.Controller as IDnnController; if (controller == null) { throw new InvalidOperationException("The DnnUrlHelper class can only be used in Views that inherit from DnnWebViewPage"); } ModuleContext = controller.ModuleContext.Configuration; Page = controller.DnnPage; }
public FitbitService(System.Web.UI.Page page, System.Web.HttpContext context) { _page = page; _context = context; // Create OAuthService object, containing oauth consumer configuration _oAuthService = OAuthService.Create( new EndPoint(RequestTokenUrl, "POST"), // requestTokenEndPoint new Uri(AuthorizationUrl), // authorizationUri new EndPoint(AccessTokenUrl, "POST"), // accessTokenEndPoint true, // useAuthorizationHeader "https://api.fitbit.com", // realm "HMAC-SHA1", // signatureMethod "1.0", // oauthVersion new OAuthConsumer(ConsumerKey, ConsumerSecret) // consumer ); }
public string GetSideCart(bool showButton) { System.Web.UI.Page page = new System.Web.UI.Page(); WebUserControl1 ctl = (WebUserControl1)page.LoadControl("~/WebUserControl1.ascx"); page.Controls.Add(ctl); System.IO.StringWriter writer = new System.IO.StringWriter(); try { HttpContext.Current.Server.Execute(page, writer, false); page.Dispose(); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message + " " + ex.StackTrace); } return writer.ToString(); }
public static System.Web.UI.Control LoadOfferEditor(string taskName, System.Web.UI.Page p) { string fullName = "BVModules\\Offers\\" + taskName + "\\Edit.ascx"; return(LoadSingleControl(fullName, ref p)); }
public void Convert(Document pdfDoc, System.Web.UI.Page page) { const string METHOD_NAME = "Convert"; try { _page = page; float width = pdfDoc.PageSize.Width; float marginLeft = pdfDoc.LeftMargin; float marginRight = pdfDoc.RightMargin; foreach (XmlNode node in _docElem.ChildNodes) { Paragraph para = null; switch (node.Name) { case "addressBlock": para = GetAddressBlock(node); pdfDoc.Add(para); break; case "image": pdfDoc.Add(GetImage(node)); break; case "newLine": Phrase phrase = new Phrase("\n"); pdfDoc.Add(phrase); break; case "paragraph": para = GetParagraph(node); pdfDoc.Add(para); break; case "table": pdfDoc.Add(GetTable(node)); break; } } } catch (Exception ex) { ApplicationException aex = new ApplicationException(MOD_NAME + METHOD_NAME, ex); throw (aex); } }
public static System.Web.UI.Control LoadEditor(string editorName, System.Web.UI.Page p) { string fullName = "BVModules\\Editors\\" + editorName + "\\editor.ascx"; return(LoadSingleControl(fullName, ref p)); }
// <summary>记录错误日志 // </summary> //<param name="dic"></param> // <returns></returns> private static void WriteErro(Exception filterContext) { if (isErlog) { DateTime now = DateTime.Now; string fatherName = "/App_Data/" + "Logs_" + now.ToString("yyyy-MM") + "/"; string savePath = new System.Web.UI.Page().Server.MapPath(fatherName); if(!Directory.Exists(savePath)) { Directory.CreateDirectory(savePath); } string fileName = now.ToString("yyyy-MM-dd") + ".txt"; System.Text.StringBuilder sb = new System.Text.StringBuilder(); var mBase = System.Reflection.MethodBase.GetCurrentMethod(); sb.AppendLine("----------------------------------header---------------------------------<br/>"); sb.AppendLine("访问地址:" + HttpContext.Current.Request.Url.PathAndQuery + " 访问类名:" + mBase.DeclaringType.FullName + "执行方法:" + mBase.Name + "<br/>"); sb.AppendLine("异常来自:" + filterContext.TargetSite.ReflectedType.ToString() + "." + filterContext.TargetSite.Name + "<br/>"); sb.AppendLine("异常信息:" + filterContext.Message + "<br/>"); sb.AppendLine("发生时间:" + now + "<br/>"); sb.AppendLine("----------------------------------footer----------------------------------<br/>"); System.IO.File.AppendAllText(savePath + fileName , sb.ToString()); } }
public static void VerEquipos(System.Web.UI.Page pagina, string videquipo, string vhtipo, string vhequipo) { string wFecha = inicio + id + videquipo + htipo + vhtipo + hequipo + vhequipo + "','', " + atributos + "</script>"; pagina.ClientScript.RegisterStartupScript(pagina.GetType(), "ventana", wFecha); }
public ContextHelper(DnnController context) { Requires.NotNull("context", context); ModuleContext = context.ModuleContext.Configuration; Page = context.DnnPage; }
/// <summary> /// Determine the logical page being requested by evaluating the routedata, or querystring and /// then loading the appropriate layout (ASPX) page /// </summary> /// <param name="requestContext"></param> /// <returns></returns> System.Web.IHttpHandler IRouteHandler.GetHttpHandler(RequestContext requestContext) { if (requestContext == null) { throw new ArgumentNullException("requestContext"); } try { string pageId = ""; int routeId = 0; var parms = new Dictionary <string, string>(); // Pages using the default routing URL will have the page id in the RouteData.Values collection if (requestContext.RouteData.Values["PageId"] != null) { pageId = (string)requestContext.RouteData.Values["PageId"]; } // Pages that use a custom URL route will have the page id in the RouteDate.DataTokens collection else if (requestContext.RouteData.DataTokens["PageId"] != null) { pageId = (string)requestContext.RouteData.DataTokens["PageId"]; routeId = Int32.Parse((string)requestContext.RouteData.DataTokens["RouteId"]); foreach (var routeParm in requestContext.RouteData.Values) { parms.Add(routeParm.Key, (string)routeParm.Value); } } // If page has not been specified get the site by the domain and use the site's default page else { SiteCache site = SiteCache.GetSiteByDomain(requestContext.HttpContext.Request.Url.Host); // if not found use the default site if (site == null) { site = SiteCache.Read(SystemGuid.Site.SITE_ROCK_INTERNAL.AsGuid()); } if (site != null) { if (site.DefaultPageId.HasValue) { pageId = site.DefaultPageId.Value.ToString(); } if (site.DefaultPageRouteId.HasValue) { routeId = site.DefaultPageRouteId.Value; } } if (string.IsNullOrEmpty(pageId)) { throw new SystemException("Invalid Site Configuration"); } } PageCache page = null; if (!string.IsNullOrEmpty(pageId)) { int pageIdNumber = 0; if (Int32.TryParse(pageId, out pageIdNumber)) { page = PageCache.Read(pageIdNumber); } } if (page == null) { // try to get site's 404 page SiteCache site = SiteCache.GetSiteByDomain(requestContext.HttpContext.Request.Url.Host); if (site != null && site.PageNotFoundPageId != null) { if (Convert.ToBoolean(GlobalAttributesCache.Read().GetValue("Log404AsException"))) { Rock.Model.ExceptionLogService.LogException( new Exception(string.Format("404 Error: {0}", requestContext.HttpContext.Request.Url.AbsoluteUri)), requestContext.HttpContext.ApplicationInstance.Context); } page = PageCache.Read(site.PageNotFoundPageId ?? 0); } else { // no 404 page found for the site, return the default 404 error page return((System.Web.UI.Page)BuildManager.CreateInstanceFromVirtualPath("~/Http404Error.aspx", typeof(System.Web.UI.Page))); } } string theme = page.Layout.Site.Theme; string layout = page.Layout.FileName; string layoutPath = PageCache.FormatPath(theme, layout); try { // Return the page for the selected theme and layout Rock.Web.UI.RockPage cmsPage = (Rock.Web.UI.RockPage)BuildManager.CreateInstanceFromVirtualPath(layoutPath, typeof(Rock.Web.UI.RockPage)); cmsPage.SetPage(page); cmsPage.PageReference = new PageReference(page.Id, routeId, parms, requestContext.HttpContext.Request.QueryString); return(cmsPage); } catch (System.Web.HttpException) { // The Selected theme and/or layout didn't exist, attempt first to use the layout in the default theme. theme = "Rock"; // If not using the default layout, verify that Layout exists in the default theme directory if (layout != "FullWidth" && !File.Exists(requestContext.HttpContext.Server.MapPath(string.Format("~/Themes/Rock/Layouts/{0}.aspx", layout)))) { // If selected layout doesn't exist in the default theme, switch to the Default layout layout = "FullWidth"; } // Build the path to the aspx file to layoutPath = PageCache.FormatPath(theme, layout); // Return the default layout and/or theme Rock.Web.UI.RockPage cmsPage = (Rock.Web.UI.RockPage)BuildManager.CreateInstanceFromVirtualPath(layoutPath, typeof(Rock.Web.UI.RockPage)); cmsPage.SetPage(page); cmsPage.PageReference = new PageReference(page.Id, routeId, parms, requestContext.HttpContext.Request.QueryString); return(cmsPage); } } catch (Exception ex) { if (requestContext.HttpContext != null) { requestContext.HttpContext.Cache["RockExceptionOrder"] = "66"; requestContext.HttpContext.Cache["RockLastException"] = ex; } System.Web.UI.Page errorPage = (System.Web.UI.Page)BuildManager.CreateInstanceFromVirtualPath("~/Error.aspx", typeof(System.Web.UI.Page)); return(errorPage); } }
// ------------------------------------------------------------------ /// <summary> /// Parse a query string and insert the found parameters /// into the collection of this class. /// </summary> public void FromUrl( System.Web.UI.Page page ) { if ( page!=null ) { InternalCurrentPage = page; FromUrl( InternalCurrentPage.Request.RawUrl ); } }
/// <summary> /// 下载Excel文件 /// </summary> /// <param name="page">页面</param> /// <param name="filePath">文件路径</param> public static void DownLoadExcel(System.Web.UI.Page page, string filePath) { page.ClientScript.RegisterStartupScript(page.GetType(), "downfile", "window.open('" + filePath + "','newwindow', 'height=68, width=24, top=350, left=500, toolbar=0, menubar=0, scrollbars=0, resizable=1,location=0, status=0');", true); }
public static T QueryString <T>(this System.Web.UI.Page page, string param) { return(QueryString <T>(HttpContext.Current.Request, param)); }
/// <summary> /// 检查用户注册输入的验证码是否有效 /// </summary> /// <param name="page">控件所属页面的实例</param> /// <param name="checkCode">用户输入的验证码</param> /// <returns></returns> public static bool IsRegisterValid(System.Web.UI.Page page, string checkCode) { return(page.Request.Cookies[ImageVerificationCode.REGISTER_COOKIE_NAME].Value.ToLower() == checkCode.Trim().ToLower()); }
public static System.Web.UI.Control LoadContentBlockEditor(string blockName, System.Web.UI.Page p) { string fullName = "BVModules\\ContentBlocks\\" + blockName + "\\editor.ascx"; return(LoadSingleControl(fullName, ref p)); }
public static System.Web.UI.Control LoadDefaultEditor(System.Web.UI.Page p) { return(LoadEditor(WebAppSettings.DefaultTextEditor, p)); }
public void UserControlIsBuiltUpOnInit() { MockWebClientApplication application = new MockWebClientApplication(); MockHttpContext mockContext = new MockHttpContext(); mockContext.Request = new HttpRequest("page.aspx", "http://application/page.aspx", null); mockContext.ApplicationInstance = application; application.SetTestCurrentContext(mockContext); System.Web.UI.Page page = new System.Web.UI.Page(); MockUserControl uc = (MockUserControl) page.LoadControl(typeof (MockUserControl), null); page.Controls.Add(uc); Assert.IsFalse(uc.OnBuiltUpCalled); uc.FireOnInit(); Assert.IsTrue(uc.OnBuiltUpCalled); }
/// <summary> /// 自动获取表单信息 /// </summary> /// <param name="page">页面对象 </param> public void AutoForm(System.Web.UI.Page page) { if (page.Request["iD"] != null) { if (this.iD_initialized) { if (page.Request["iD"] != "") { this.ID = Convert.ToInt32(page.Request["iD"]); } else { this.iD_initialized = false; } } else { this.ID = Convert.ToInt32(page.Request["iD"]); } } if (page.Request["addID"] != null) { if (this.addID_initialized) { if (page.Request["addID"] != "") { this.AddID = Convert.ToInt32(page.Request["addID"]); } else { this.addID_initialized = false; } } else { this.AddID = Convert.ToInt32(page.Request["addID"]); } } if (page.Request["addTime"] != null) { if (this.addTime_initialized) { if (page.Request["addTime"] != "") { this.AddTime = Convert.ToDateTime(page.Request["addTime"]); } else { this.addTime_initialized = false; } } else { this.AddTime = Convert.ToDateTime(page.Request["addTime"]); } } if (page.Request["brief"] != null) { if (this.brief_initialized) { if (page.Request["brief"] != "") { this.Brief = Convert.ToString(page.Request["brief"]); } else { this.brief_initialized = false; } } else { this.Brief = Convert.ToString(page.Request["brief"]); } } if (page.Request["exhibitionID"] != null) { if (this.exhibitionID_initialized) { if (page.Request["exhibitionID"] != "") { this.ExhibitionID = Convert.ToInt32(page.Request["exhibitionID"]); } else { this.exhibitionID_initialized = false; } } else { this.ExhibitionID = Convert.ToInt32(page.Request["exhibitionID"]); } } }
/// <summary> /// Captura o usuário corrente /// </summary> /// <returns></returns> public static string GetUser()//Usuário logado + domínio { //string UsName = WindowsIdentity.GetCurrent().Name;//Domínio + Login var x = new System.Web.UI.Page(); string usName = x.Page.User.Identity.Name.ToString(); return usName.Replace(@"ECOURBIS\", "").ToLower(); }
/// <summary> /// 在body开始处输出js(将 JavaScript 嵌入到页面中开始元素 form 的紧后面) /// </summary> /// <param name="page">page对象</param> /// <param name="js">js代码</param> public static void AddBodyStart(System.Web.UI.Page page, String js) { page.ClientScript.RegisterClientScriptBlock(page.GetType(), Guid.NewGuid().ToString(), @"<script type='text/javascript' >" + js + "</script>"); }
/// <summary> /// Initialise the IDS to scan output /// </summary> /// <param name="oF">An OutputFilter</param> internal IDS(OutputFilter oF) { _store = oF._store; _pageOutput = oF.Output; _page = oF.Page; _report = new Report(RequestType.Output); _isRaw = true; _oF = oF; }
public static System.Web.UI.WebControls.WebParts.WebPartManager GetCurrentWebPartManager(System.Web.UI.Page page) { return(default(System.Web.UI.WebControls.WebParts.WebPartManager)); }
public string GetSearchView(SearchGroup searchGroup) { var page = new System.Web.UI.Page(); var oSearchView = (SearchView) LoadControl(PathProvider.GetControlVirtualPath("SearchView.ascx")); oSearchView.SearchGroup = searchGroup; oSearchView.IsListView = ProjectID == -1; oSearchView.SearchText = SearchText; page.Controls.Add(oSearchView); var writer = new System.IO.StringWriter(); HttpContext.Current.Server.Execute(page, writer, false); var output = writer.ToString(); writer.Close(); return output; }
/// <summary> /// 注册脚本块 /// </summary> public static void RegisterScriptBlock(System.Web.UI.Page page, string _ScriptString) { page.ClientScript.RegisterStartupScript(page.GetType(), "scriptblock", "<script type='text/javascript'>" + _ScriptString + "</script>"); }
/// <summary> /// 给微信支付做准备,更新相应的数据表 /// </summary> /// <param name="dicPar"></param> public void GetPayParamsRecharge(Dictionary <string, object> dicPar) { var wxJsApiParam = string.Empty; ///要检测的参数信息 money:单位为分 List <string> pra = new List <string>() { "GUID", "USER_ID", "money", "stocode", "strJson", "cardID", "memcode" }; //检测方法需要的参数 if (!CheckActionParameters(dicPar, pra)) { return; } var openid = dicPar["USER_ID"].ToString(); //var wxopenid = Convert.ToString(SQLTool.ExecuteScalar("SELECT wxopenid FROM WX_members_wx WHERE openid='" + openid + "'")); var total_fee = Convert.ToDecimal(dicPar["money"].ToString()); var stocode = dicPar["stocode"].ToString(); var strJson = Convert.ToString(dicPar["strJson"]).Replace('\'', '"'); var cardId = dicPar["cardID"].ToString(); var memcode = dicPar["memcode"].ToString(); System.Web.UI.Page page = new System.Web.UI.Page(); //若传递了相关参数,则调统一下单接口,获得后续相关接口的入口参数 JsApiPay jsApiPay = new JsApiPay(page); jsApiPay.openid = openid; jsApiPay.total_fee = Convert.ToInt32(total_fee * 100); //*100 //JSAPI支付预处理 try { SetParam.SetParams(stocode); WxPayData unifiedOrderResult = jsApiPay.GetUnifiedOrderResult(); wxJsApiParam = jsApiPay.GetJsApiParameters();//获取H5调起JS API参数 try { var detailcode = Convert.ToString(SQLTool.ExecuteScalar("declare @ordcode varchar(32); exec [dbo].[p_GetOrderCode] @ordcode output;select 'WX'+@ordcode;")); var sql = "insert into WX_orderdetails(source,buscode,stocode,openid,orderno,sumprice,money,discountprice,status,payType,out_trade_no,postJson) values ('wechat','88888888','" + stocode + "','" + openid + "','" + detailcode + "','" + total_fee + "','" + total_fee + "','" + total_fee + "','0','3','" + jsApiPay.out_trade_no + "','" + strJson + "');"; if (!string.IsNullOrEmpty(cardId)) { sql += "update members set IDNO='" + Tools.SafeSql(cardId) + "' where ISNULL(IDNO,'')='' and memcode='" + memcode + "';"; } SQLTool.ExecuteNonQuery(sql); } catch (Exception ex) { ErrorLog.WriteErrorMessage(ex.ToString()); } } catch (Exception ex) { // wxJsApiParam = ""; ErrorLog.WriteErrorMessage("ex:" + ex.ToString()); } try { Pagcontext.Response.Clear(); Pagcontext.Response.Write(wxJsApiParam); } catch (Exception) { } finally { Pagcontext.Response.End(); } }
// Methods public virtual void ApplyStyleSheetSkin(System.Web.UI.Page page) { }
/// <summary> /// Constructor /// </summary> /// <param name="CurrentPage"></param> public MessageBox(System.Web.UI.Page CurrentPage) { this.p = CurrentPage; }
/// <summary> /// Page extention method to get root javascript path /// </summary> /// <param name="objPage">The obj page.</param> /// <returns></returns> /// <remarks></remarks> public static string GetJScriptPath(this System.Web.UI.Page objPage) { return(GetJScriptPath()); }
/// <summary> /// Page值 /// </summary> /// <param name="page"></param> /// <param name="scriptPre"></param> public LhgDialog(System.Web.UI.Page page, string scriptPre = "frameElement.api.opener.$$") { this.page = page; DialogScript = scriptPre; }
/// <summary> /// Static method to get root javascript path /// </summary> /// <returns></returns> /// <remarks></remarks> public static string GetJScriptlibraryPath(this System.Web.UI.Page objPage) { return(strRoolPath + "/assets/scripts/"); }
public static string RenderUserControl(string path, bool useFormLess, Dictionary<string, string> controlParams, string assemblyName, string controlName, HttpContext context) { System.Web.UI.Page pageHolder = null; if (useFormLess) { pageHolder = new FormlessPage() { AppRelativeTemplateSourceDirectory = HttpRuntime.AppDomainAppVirtualPath }; //needed to resolve "~/" } else { pageHolder = new System.Web.UI.Page() { AppRelativeTemplateSourceDirectory = HttpRuntime.AppDomainAppVirtualPath }; } System.Web.UI.UserControl viewControl = null; //use path by default if (String.IsNullOrEmpty(path)) { //load assembly and usercontrol when .ascx is compiled into a .dll string controlAssemblyName = string.Format("{0}.{1},{0}", assemblyName, controlName); Type type = Type.GetType(controlAssemblyName); viewControl = (System.Web.UI.UserControl)pageHolder.LoadControl(type, null); } else { viewControl = (System.Web.UI.UserControl)pageHolder.LoadControl(path); } pageHolder.EnableViewState = false; viewControl.EnableViewState = false; if (controlParams != null && controlParams.Count > 0) { foreach (var keyValuePair in controlParams) { Type viewControlType = viewControl.GetType(); System.Reflection.PropertyInfo property = viewControlType.GetProperty(keyValuePair.Key); if (property != null) { object value; DateTime date; if (property.PropertyType == typeof(bool)) value = bool.Parse(keyValuePair.Value); else if (property.PropertyType == typeof(Int32)) value = Int32.Parse(keyValuePair.Value); else if (property.PropertyType == typeof(Guid)) value = new Guid(keyValuePair.Value); else if (property.PropertyType == typeof(DateTime) && DateTime.TryParse(keyValuePair.Value, out date)) value = date; else value = keyValuePair.Value; try { property.SetValue(viewControl, value, null); } catch (Exception ex) { //need to hook into external logger, throw? } } } } string parseIndex = System.Guid.NewGuid().ToString(); if (useFormLess) { pageHolder.Controls.Add(viewControl); } else { System.Web.UI.HtmlControls.HtmlForm form = new System.Web.UI.HtmlControls.HtmlForm(); System.Web.UI.ScriptManager sm = new System.Web.UI.ScriptManager(); sm.EnableCdn = true; sm.AjaxFrameworkMode = System.Web.UI.AjaxFrameworkMode.Disabled; System.Web.UI.WebControls.Literal litParseIndex = new System.Web.UI.WebControls.Literal(); litParseIndex.Text = parseIndex; form.Controls.Add(sm); form.Controls.Add(litParseIndex); form.Controls.Add(viewControl); pageHolder.Controls.Add(form); } System.IO.StringWriter output = new System.IO.StringWriter(); context.Server.Execute(pageHolder, output, false); string renderedContent = output.ToString(); if (renderedContent.Contains("<form method=")) //have to have a form and scriptmananger to render sometimes but we don't want it on the client { renderedContent = renderedContent.Substring(renderedContent.IndexOf(parseIndex) + parseIndex.Length); renderedContent = renderedContent.Replace(renderedContent.Substring(renderedContent.LastIndexOf("</form>"), 7), ""); } return renderedContent; }
/// <summary> /// Page extention method to get root css path /// </summary> /// <param name="objPage">The obj page.</param> /// <returns></returns> /// <remarks></remarks> public static string GetNewCSSPath(this System.Web.UI.Page objPage) { return(strRoolPath + "/assets/scss/"); }
/// <summary> /// ������ /// </summary> /// <param name="cPage"></param> /// <param name="cDg"></param> public SMDataGrid(System.Web.UI.Page cPage, ref System.Web.UI.WebControls.DataGrid cDg) { mPage = cPage; mDg = cDg; }
/// <summary> /// Static method to get image path /// </summary> /// <param name="objPage">The obj page.</param> /// <param name="strPath">Image name with subfolder path</param> /// <returns></returns> /// <remarks></remarks> public static string GetNewImagePath(this System.Web.UI.Page objPage, string strPath = "") { return(GetNewDesignImagePath(strPath)); }
/// <summary> /// ����¡ ������ /// </summary> /// <param name="Page"></param> /// <param name="lblPage"></param> public Pager(System.Web.UI.Page Page, ref System.Web.UI.WebControls.Label lblPage) { mPage = Page; mlblPage = lblPage; }
public static System.Web.UI.Control LoadCreditCardGatewayEditor(string gatewayName, System.Web.UI.Page p) { string fullName = "BVModules\\CreditCardGateways\\" + gatewayName + "\\edit.ascx"; return(LoadSingleControl(fullName, ref p)); }
public AccessMatrix(System.Web.UI.Page page) { m_page = page; }
public Payment(System.Web.UI.Page _Page, System.Web.UI.WebControls.Literal _txtEncrypted) { this.__Page = _Page; this.__txtEncrypted = _txtEncrypted ; }
void IControlDesignerAccessor.SetOwnerControl(Control owner) { if (owner == this) { throw new ArgumentException(System.Web.SR.GetString("Control_CannotOwnSelf"), "owner"); } this.OwnerControl = owner; this._parent = owner.Parent; this._page = owner.Page; }
public static System.Web.UI.Control LoadPaymentMethodEditor(string methodName, System.Web.UI.Page p) { string fullName = "BVModules\\PaymentMethods\\" + methodName + "\\edit.ascx"; return(LoadSingleControl(fullName, ref p)); }
public static void VerReasignacion(System.Web.UI.Page pagina, string hsoporte) { string wFecha = iReasignar + idReasignar + "','', " + aReasignar + "</script>"; pagina.ClientScript.RegisterStartupScript(pagina.GetType(), "ventana", wFecha); }
/// <summary> /// 输出自定义脚本信息 /// </summary> /// <param name="page">当前页面指针,一般为this</param> /// <param name="script">输出脚本</param> public static void ResponseScript(System.Web.UI.Page page, string script) { page.ClientScript.RegisterStartupScript(page.GetType(), "message", "<script language='javascript' defer>" + script + "</script>"); }
public static bool there_file(System.Web.UI.Page page) { return(page.Request.Headers["dn-post-file"] != null); }
public void OnRequestStart(System.Web.UI.Page webPage) { }
/// <summary> /// 给微信支付做准备,更新相应的数据表 /// </summary> /// <param name="dicPar"></param> public void GetPayParams(Dictionary <string, object> dicPar) { var wxJsApiParam = string.Empty; ///要检测的参数信息 money:单位为分 List <string> pra = new List <string>() { "GUID", "USER_ID", "money", "stocode", "orderno", "type", "zkje", "zkcode", "zkname", "yhje", "yhcode", "yhname", "strJson" }; //检测方法需要的参数 if (!CheckActionParameters(dicPar, pra)) { return; } try { var openid = dicPar["USER_ID"].ToString(); var wxopenid = Convert.ToString(SQL.SQLTool.ExecuteScalar("SELECT wxopenid FROM WX_members_wx WHERE openid='" + openid + "'")); var total_fee = Convert.ToDecimal(dicPar["money"].ToString()); var stocode = dicPar["stocode"].ToString(); var orderno = dicPar["orderno"].ToString(); var strJson = Convert.ToString(dicPar["strJson"]).Replace('\'', '"'); var sresult = Dishes.GetSoldResult(stocode, strJson); if (!string.IsNullOrEmpty(sresult)) { ToCustomerJson("1", "菜品【" + sresult + "】已售罄"); return; } System.Web.UI.Page page = new System.Web.UI.Page(); //若传递了相关参数,则调统一下单接口,获得后续相关接口的入口参数 JsApiPay jsApiPay = new JsApiPay(page); jsApiPay.openid = wxopenid; jsApiPay.total_fee = Convert.ToInt32(total_fee * 100); //*100 //JSAPI支付预处理 //查询该订单是否已有商户订单号 var otn = "select out_trade_no from WX_orderdetails where orderno='" + orderno + "' AND openid='" + openid + "'"; //查询是否已支付,如果已经支付过,返回错误信息给前端 var existSql = "select trade_state from wx_pay where out_trade_no=(" + otn + ")"; var result = Convert.ToString(SQL.SQLTool.ExecuteScalar(existSql)); if (result == "SUCCESS") { wxJsApiParam = "paid"; } else { SetParam.SetParams(stocode); WxPayData unifiedOrderResult = jsApiPay.GetUnifiedOrderResult(); wxJsApiParam = jsApiPay.GetJsApiParameters();//获取H5调起JS API参数 var zkmoney = dicPar["zkje"].ToString(); var yhmoney = dicPar["yhje"].ToString(); try { //此处更新订单及支付相关的表 var sql = "update WX_orderdetails set postJson='" + strJson + "',out_trade_no='" + jsApiPay.out_trade_no + "',discountprice='" + total_fee + "',privilegepre='" + zkmoney + "',singlemoney='" + yhmoney + "' where orderno='" + orderno + "' AND openid='" + openid + "';UPDATE WX_choorderdetail SET conmoney='" + total_fee + "' WHERE detailcode='" + orderno + "';UPDATE dbo.choorderdetailBreakhistory SET yhqmoney='" + yhmoney + "',zkmoney='" + zkmoney + "',disratemoney='" + yhmoney + "',cardCode='" + dicPar["zkcode"].ToString() + "',cschemediscmoney='" + zkmoney + "',dispname='" + dicPar["zkname"].ToString() + "',disccardCode='" + dicPar["zkcode"].ToString() + "' where detailcodes='" + orderno + "';UPDATE dbo.chopayhistory SET couponmoney='" + yhmoney + "',accountcode='" + dicPar["zkcode"].ToString() + "',paymoney='" + total_fee + "',rmmoney='" + total_fee + "' where detailcode='" + orderno + "'"; var type = Convert.ToString(dicPar["type"]); if (type == "3") //0后支付,1先支付,2打赏,3充值 { var detailcode = Convert.ToString(SQLTool.ExecuteScalar("SELECT dbo.f_GetChoorderNo()")); sql = "insert into WX_orderdetails(source,buscode,stocode,openid,orderno,sumprice,money,discountprice,status,payType,out_trade_no,cardCode,postJson) values ('wechat','88888888','" + stocode + "','" + openid + "','" + detailcode + "','" + total_fee + "','" + total_fee + "','" + total_fee + "','0','" + type + "','" + jsApiPay.out_trade_no + "','" + orderno + "','" + strJson + "')"; } SQLTool.ExecuteNonQuery(sql); } catch (Exception ex) { ErrorLog.WriteErrorMessage(ex.ToString()); } } } catch (Exception ex) { wxJsApiParam = ""; ErrorLog.WriteErrorMessage(ex.ToString()); } Pagcontext.Response.Clear(); Pagcontext.Response.Write(wxJsApiParam); Pagcontext.Response.End(); }
public SessionUpdater(System.Web.UI.Page page) { this.page = page; }
private void GetWebDesignerHost(ProjectItem projItem) { #if VS90 //FDesignWindow = projItem.Open("{7651A702-06E5-11D1-8EBD-00A0C90F26EA}"); FDesignWindow = projItem.Open(Constants.vsViewKindDesigner); FDesignWindow.Activate(); HTMLWindow W = (HTMLWindow)FDesignWindow.Object; W.CurrentTab = vsHTMLTabs.vsHTMLTabsDesign; if (W.CurrentTabObject is WebDevPage.DesignerDocument) { FDesignerDocument = W.CurrentTabObject as WebDevPage.DesignerDocument; } #else FDesignWindow = projItem.Open("{00000000-0000-0000-0000-000000000000}"); FDesignWindow.Activate(); FDesignWindow = projItem.Open("{7651A702-06E5-11D1-8EBD-00A0C90F26EA}"); FDesignWindow.Activate(); HTMLWindow W = (HTMLWindow)FDesignWindow.Object; object o = W.CurrentTabObject; IntPtr pObject; Microsoft.VisualStudio.OLE.Interop.IServiceProvider oleSP = (Microsoft.VisualStudio.OLE.Interop.IServiceProvider)o; Guid sid = typeof(IVSMDDesigner).GUID; Guid iid = typeof(IVSMDDesigner).GUID; int hr = oleSP.QueryService(ref sid, ref iid, out pObject); System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr); if (pObject != IntPtr.Zero) { try { Object TempObj = Marshal.GetObjectForIUnknown(pObject); if (TempObj is IDesignerHost) { FDesignerHost = (IDesignerHost)TempObj; } else { Object ObjContainer = TempObj.GetType().InvokeMember("ComponentContainer", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.GetProperty, null, TempObj, null); if (ObjContainer is IDesignerHost) { FDesignerHost = (IDesignerHost)ObjContainer; } } FPage = (System.Web.UI.Page)FDesignerHost.RootComponent; //NotifyRefresh(200); Application.DoEvents(); } finally { Marshal.Release(pObject); } } #endif }
protected void TransformWebControls(Sitecore.Pipelines.RenderField.RenderFieldArgs args) { System.Web.UI.Page page = new System.Web.UI.Page(); page.AppRelativeVirtualPath = "/"; System.Web.UI.Control control = page.ParseControl(args.Result.FirstPart); args.Result.FirstPart = Sitecore.Web.HtmlUtil.RenderControl(control); }
/// <summary> /// 显示消息提示对话框,并进行页面跳转 /// </summary> /// <param name="page">当前页面指针,一般为this</param> /// <param name="msg">提示信息</param> /// <param name="url">跳转的目标URL</param> public static void ShowAndRedirect(System.Web.UI.Page page, string msg, string url) { //Response.Write("<script>alert('帐户审核通过!现在去为企业充值。');window.location=\"" + pageurl + "\"</script>"); page.ClientScript.RegisterStartupScript(page.GetType(), "message", "<script language='javascript' defer>alert('" + msg + "');window.location=\"" + url + "\"</script>"); }
public static System.Web.UI.Control LoadShippingEditor(string shippingName, System.Web.UI.Page p) { string fullName = "BVModules\\Shipping\\" + shippingName + "\\edit.ascx"; return(LoadSingleControl(fullName, ref p)); }
public Payment(System.Web.UI.Page _Page, System.Web.UI.WebControls.Literal _txtEncrypted, ShoppingCart _shc) { this.__Page = _Page; this.__txtEncrypted = _txtEncrypted; this.shc = _shc; }
/// <summary> /// 显示消息提示对话框 /// </summary> /// <param name="page">当前页面指针,一般为this</param> /// <param name="msg">提示信息</param> public static void Show(System.Web.UI.Page page, string msg) { page.ClientScript.RegisterStartupScript(page.GetType(), "message", "<script language='javascript' defer>alert('" + msg.ToString() + "');</script>"); }