w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
accessing parent page variables from page opened with AJAX
The simple answer is that you cannot. When the browser deals with the parent page, it has no knowledge of what/how generated it - all it sees is an HTML page, hence there are no variables of any kind that it knows about. When you're invoking another PHP script using AJAX, the browser simply makes another call to the server. A new process is started on the server to run that script - and it has no knowledge of the parent page generation (which most likely has finished loading by now, anyway, and the script exited). The only way to avoid using GET or POST values in the ajax request is to use cookies. You can set a cookie value (using setcookie() function) from the parent page and then read is in the ajax page (using $_COOKIE superglobal). EDIT: Just realised the obvious: you can also us

Categories : PHP

PageMethods is not Defined in ASPX Page
You can invoke ASP.NET AJAX Page Methods via jQuery, like this: $.ajax({ type: "POST", url: "PageName.aspx/MethodName", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { // Do something interesting here. } });

Categories : Javascript

Setting session value in aspx page
You can't, at least not like this. JavaScript is client-side thus rendered after the server-side (C#). That means you can't assign session values directly through JavaScript. One way to solve your problem would be to use AJAX to asyncronously send a request to server and change value of the session. Example how to do it.

Categories : Asp Net

Session variables don't get passed to the third page after session start
I don't know what is in your objects.php, calling session should probably come before that. session_start(); require("objects.php"); echo session_id(); echo $_SESSION["loggedin"];

Categories : Misc

Jekyll accessing page variables from CSS
Only files with a YAML front matter section, and with the extensions .html, .markdown, .md, or .textile get processed by Jekyll. You could hack this to get it working by saving your CSS file with one of those extensions, and including a YAML front matter section. That seems like a pretty clumsy way to do it, and it'll make for some ugly code, but it might work.

Categories : CSS

Accessing .ASPX page on password protected site from within same site
If you want you can remove authentication for just one page as follows. <location path="mypage.aspx"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location>

Categories : Asp Net

I cant get/access the value of my session variables to another page
index.php session_start(); $row = mysqli_fetch_array($result); if(mysqli_num_rows($result) > 0){ session_regenerate_id(); $user = mysqli_fetch_assoc($result); $_SESSION['SESS_ID'] = $user['id']; $_SESSION['SESS_UNAME'] = $user['username']; $_SESSION['SESS_PASS'] = $user['password']; session_write_close(); header("location:home.php"); exit(); } Add session_start() on the index.php

Categories : PHP

Calender - jQuery works on stand along but not when on a .aspx page with a master page
You are using your variables as a constant so any element will match the selector, instead of this: var lblDateStart = '<%= lblDateStart.ClientId %>'; function setLabelStart(yourDate1) { $("#lblDateStart").val(yourDate1); } var lblDateEnd = '<%= lblDateEnd.ClientId %>'; function setLabelEnd(yourDate2) { $("#lblDateEnd").val(yourDate2); } use this: var lblDateStart = '#<%= lblDateStart.ClientId %>'; function setLabelStart(yourDate1) { $(lblDateStart).val(yourDate1); } var lblDateEnd = '#<%= lblDateEnd.ClientId %>'; function setLabelEnd(yourDate2) { $(lblDateEnd).val(yourDate2); } as you can see the # is contained in the selector variable to get the value of the matched element.

Categories : Jquery

how to add an event property to a user control ascx accessible to the host page as a string in aspx page?
Please see the link below. I think it is quite near to yours. or you can search for event bubbling. Bubbling Events to Parent in ASP.NET Download sample code from here. It has two user controls and one aspx page with event bubbling implmentation https://skydrive.live.com/embed?cid=7A1FCBEC2CC6F643&resid=7A1FCBEC2CC6F643%212034&authkey=AANtP8lOxmwRJcQ

Categories : Asp Net

use variable in aspx page load from event raised in ascx, and build dynamic buttons on page
I think I see what you're doing that is causing your problem. To be sure I understand, though... you have built a custom control (an .ascx) that you are adding to your web form dynamically by adding it to a placeholder control. However, when the user interacts with the custom control, the event is not getting raised to the parent. I think that you've got a good start here, but I'd like to give a recommendation on a slightly different way to approach this. It might also clean up your code a little and keep you from having to build the control twice in one page lifetime. First, change your "BuildCrumbs" sub to the following (you'll probably need to change the "Dim mybtn2" line to match the details of your project): Private Sub BuildCrumbs(IsNewControl As Boolean) Dim mybtn2 As Peop

Categories : Asp Net

how to change title of aspx page dynamically on page load
In your master page, mention the header as <head><title>@ViewBag.Title</title></head>. Conveniently set the Title property on all your other pages, like: @{ ViewBag.Title = "My new title"; }

Categories : C#

To prevent expiring session variables in submit page, should I assign session variable to viewstate variable?
Yes, you can do it. but viewstate tends to slow the page loading due to extra overhead. If your dataset is small it is ok, but if its bigger then look for other alternatives. How ever I will recommend not to go with this method[security problem,slow etc.], instead device a way so that session dosent expire if any page is open?? how?? use jquery/ajax to maintain a connection with server at regular interval. If you want to go some further implement sql session. It will be the best. Hope these info help you.

Categories : C#

Session variables are not cleared when the page is refreshed
Try for Session.Abandon() method. or Session.Clear() I think you need to use any of the method inside your Page_Load method.

Categories : C#

Set property of Page on Response.Redirect("Page.aspx")
You can use the following approach 1.Using Query String (Which is already implemented by you) 2.Using Session Variables You are using asp.net better to use multi-view instead of Divs

Categories : Asp Net

Execute Page_Load on MAIN.aspx after/while returning from a CHILD (windowed) aspx page
You could update your code as below: protected void btnExit_Click(object sender, EventArgs e) { // this line allows the capture of selected values gvSelection_SelectedIndexChanged(sender, e); ClientScript.RegisterStartupScript(typeof(Page), "", "window.close();window.opener.location.reload();", true); }

Categories : C#

Redirecting from one page of .aspx to another .aspx page using C#
There's some text in your dropdown that ASP.NET considers dangerous. Either change it (it's probably some possibly dangerous character like '; etc.) Or, at the top of the page in the page declaration add 'EnableEventValidation=false' There are security concerns with turning this off though so best read up on it first.

Categories : C#

trying to redirect from an ashx page to an aspx page
Since you are doing an ajax request clearly the Redirect should have no effect. What you need to do instead is do it from the client-side, on the success handler: public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string searchValue = context.Request["txtBoxValue"].ToString(); //Return the redirect URL instead context.Response.Write("SearchResults.aspx?search=" + searchValue); } $.ajax({ url: 'Handlers/SearchContent.ashx', data: { 'txtBoxValue': txtBoxValue }, success: function (data) { window.location= data;//redirect here. "data" has the full URL } }); Now, if this is all you are doing in the ashx handler, I don't really see the need for the ajax request.

Categories : C#

Apply MVC Master page to aspx page
You can't directly have a Razor Layout with WebForms Views, or a WebForms Master with Razor Views. While the concepts are similar, layouts are not masters and the concepts aren't exactly interchangeable. look Scott Hansleman blog . He had one idea . http://www.hanselman.com/blog/MixingRazorViewsAndWebFormsMasterPagesWithASPNETMVC3.aspx

Categories : Asp Net Mvc

$.post to .aspx page from asp.net mvc page
because you are not using the response: $("#deneme").bind("click", function () { $.post("@Url.Content("~/Home/Rapor/")", function (data) { alert(data); $('#anyDivID').html(data); }); });

Categories : Jquery

How to get IP address of the Client accessing my page where My web page or WebApp is hosted at some remote server
Check out this article at W3Schools: http://www.w3schools.com/asp/coll_servervariables.asp you can try: Request.ServerVariables("remote_addr")

Categories : C#

How do I wire an ascx event from a dynamically loaded ascx page into the aspx page...?
EDIT: There are two parts to the question and answer. The first part is how to "bubble" an event that occurs on a control inside the UserControl. This is accomplished by handling the inner control's event and then firing a similar event on the UserControl itself. In this case the UserControl's event shares the same name and signature as the inner control's event. This is not a requirement, but in this case it makes sense to do so. The second part is how to dynamically load UserControls yet still have the containing web page hook up to this bubbled event that is defined on each of the UserControl classes. The problem is that the ASP.NET UserControl class itself does not define the event, and the only common aspect of the dynamically loaded UserControls is the fact that they are all of type

Categories : C#

Unable to access Method with argument list in View Page defined in Model page in Rails 3
Am I right, that "active" is an attribute of user? If yes, I would change that to an instance method. Change the line in the view to: doc.activate_doctor And in the model def activate_doctor self.active = 1 # if the colum is an integer self.active = true # if the column is a boolean self.update_attribute(active, 1) # if you want to update the value directly end

Categories : Ruby On Rails

Angular -- accessing variables defined inside ngRepeat from outside
Set up a count in the controller and increment/decrement everytime editing is toggled. Then show the message if the count is 0. function MainCtrl($scope) { $scope.state = {editing: 0}; $scope.entries = [{name: 'Entry 1'}, {name: 'Entry 2'}]; }; <body ng-app> <div ng-controller="MainCtrl"> <div class="note" ng-show="state.editing == 0">This should disappear when any entry is being edited</div> <div class="entry" ng-repeat="entry in entries" ng-class="{'editing': editing}"> <span ng-hide="editing" ng-click="editing=true; state.editing = state.editing + 1">{{ entry.name }}</span> <span ng-show="editing" ng-click="editing=false; state.editing = state.editing -

Categories : Angularjs

Limit web page to 1 session per page Django
Blocking decorator: def view_only_by_one(key_function=lambda request: sha256(request.path).hexdigest()): def __dec(the_view): def __inner(request, *args, **kwargs): key_for_view = key_function(request) current_blocked = request.session.get('blocked_view'): if current_blocked and current_blocked != key_for_view: cache.set(key, None, timeout=0) user_id = cache.get(key_for_view) if user_id and user_id != request.user.id: raise PermissionDenied() cache.set(key, request.user.id, timeout=settings.ONLY_BY_ONE_BLOCK_TIME) request.session['blocked_view'] = key_for_view return the_view(request, *args, **kwargs) return __inner return _

Categories : Python

WordPress: Getting URL Variables with a Rewritten Page (Login Page)
Here's how I dealt with this when building out the WordPress for Web Apps toolkit (https://github.com/cferdinandi/web-app-starter-kit): // LOGIN FORM SHORTCODE function wpwebapp_login() { // Get current page URL $url_current = @( $_SERVER["HTTPS"] != 'on' ) ? 'http://'.$_SERVER["SERVER_NAME"] : 'https://'.$_SERVER["SERVER_NAME"]; $url_current .= ( $_SERVER["SERVER_PORT"] !== 80 ) ? ":".$_SERVER["SERVER_PORT"] : ""; $url_current .= $_SERVER["REQUEST_URI"]; $url_clean = array_shift( explode('?', $url_current) ); $login_failed = $url_clean . '?login=failed'; $signup_success = $url_clean . '?signup=success'; $reset_success = $url_clean . '?password-reset=success'; // Variables $login_status = ''; // If login failed if ( $url_current == $lo

Categories : Wordpress

Adding and Accessing Multiple Session Variables in Rails
the simplest way is that stores product's id as an array. @product = Product.find(params[:product_id]) (session[:pending_purchase] ||= []) && (session[:pending_purchase] << @product.id ) and your will find more products when you use it: @products = Product.find(session[:pending_purchase]) @products.each do |p| ......... end

Categories : Ruby On Rails

ASP.NET does not seem to need a ASPX page
This might help you to understand the issue. Aspx pages converts to dlls. http://forums.asp.net/t/1909746.aspx/1?File+updating+Issue+on+hosting+provider+server+

Categories : C#

How get variables declared on include page only (not the containing page)?
Assuming you don't have a variable named $_filename in the file: function getVarsFromPHPFile($_filename) { include $_filename; unset($_filename); return get_defined_vars(); } $includeKeys = getVarsFromPHPFile('somepage.php'); This should work provided that you aren't declaring the variables as global. Of course, if you change somepage.php to return an array (as in return array(...);), you could just do $includeKeys = include 'somepage.php'; instead.

Categories : PHP

Can't add button to aspx page
A button must be placed inside of a server managed <form> tag in order for the post to actually do anything in the ASP pipeline. However, your content place holder Content1 is inside the <head> tag of the master page, where <form> is invalid. You need to rethink your master page so that this content does not live inside of the <head> element, and include a <form runat='server'> surrounding your form. You may have meant to use the HTML 5 <header> element, which is distintly different than the normal <head> element.

Categories : C#

Meaning of "~/page.aspx"
It means the root of your application. Most of the time you run your application on the full domain so you could refer to ~/ and it would mean http://www.example.com/ but you could also set up a forum which would be set as an application all of its own in /forum/ then if you said ~/ in there it would mean http://www.example.com/forum/.

Categories : Asp Net

Run ASPX page for every 15 secs
You can use Quartz.NET Scheduling Framework for .NET Platform which is like Windows Task Scheduler but a lot better. Project site: http://www.quartz-scheduler.net/ Nuget package: http://nuget.org/packages/Quartz/

Categories : C#

using if else with eval in aspx page
You can try c# public string ProcessMyDataItem(object myValue) { if (myValue == null) { return "0 %""; } else { if(Convert.ToInt32(myValue) < 50) return "0"; else return myValue.ToString() + "%"; } } asp <div class="tooltip" style="display: none"> <div style="text-align: center; font-weight: normal"> Value =<%# ProcessMyDataItem(Eval("Percentage")) %> </div> </div>

Categories : C#

How to redirect /page/index page to /page (and /page to /page/) in Ruby on Rails?
If you don't want to cause a full reload of the page, then you should not use "redirect" in your routes, as that simply issues a browser redirect. That would cause Rails to issue a 301 "Moved Permanently". That essentially means "there is a /page/index route but it's a mistake, we don't use it anymore, please go to /page instead and never come back here." If that is the case then that is what you want to do. If you're using Passenger and will continue to use Passenger, it would be more efficient to put an Apache redirect rule in the htaccess file. It also seems strange that this is even an issue. How have /page/index, /page, and /page/ emerged in the wild as URLs that all point to the same index#index action? What is this index controller? The usual thing is to have, say, a PagesControlle

Categories : Ruby On Rails

ASPX page in DIV with FileUpload Control
You can use PreviousPage to do this. 1) Create a property in Page A to expose the file name o something else that you need to expose in Page B, for exemple: public string FileName { get { return fileUpload.FileName; } } 2) On the submit button event in Page A redirect to Page B protected void btn_Click(object sender, EventArgs e) { /*Save file here*/ this.Server.Transfer("~/PageB.aspx"); } 3) Add the directive in Page B aspx that tell which page is the PreviousPage: <%@ PreviousPageType VirtualPath="~/PageA.aspx" %> 4) Use the public property in Page B to show the result to the user, for exemple put it in a label: Label1.text = this.PreviousPage.FileName; Hopes this help! Take a look here for more info: How to: Pass Values Between ASP.NET Web Pages

Categories : HTML

Set linkButton att using Jquery in .aspx page
LinkButton is not an html tag, it is only use to generate an <a> tag. Try this: $('a.Edit-icon').each(function(){ $(this).attr('ToolTip','Edit'); });

Categories : Jquery

How do I reference a CSS file on my ASPX page?
First of all, change it to <link href="Content/Site.css" rel="stylesheet" type="text/css"/>. Also, ensure that that the path to the stylesheet is correct. Be sure you have a DOCTYPE declaration at the top of your file.

Categories : C#

how to refresh object tag in aspx page
Refer these Link it may be use full to you object tag doesn't refresh when its data attribute is changed in Chrome Changing data content on an Object Tag in HTML Refresh / Reload Page at specific intervals You can Modify these codes to your requirement.

Categories : Javascript

How can I change another page's dropdown in aspx?
You can use the following Javascript code to close child window and refresh parent(ref): window.close(); if (window.opener && !window.opener.closed) { window.opener.location.reload(); } or you can do partial refresh. see here

Categories : C#

is that possible to add controls into WebUserControl from aspx page?
You load controls dynamically via control.add method. First get an object of user control and then use control.add property for that. See following link for the reference. http://msdn.microsoft.com/en-us/library/aa287574(v=vs.71).aspx

Categories : C#

Access Function From aspx page
You cannot call any function written in your code behind in javascript. You can only call static webmethods. aspx: <asp:ScriptManager ID="smMain" runat="server" EnablePageMethods="true" /> <script type="text/javascript"> function StoreScore() { PageMethods.storescore(); } </script> cs: [System.Web.Services.WebMethod] public static void storescore() { ScoreBAL bal = new ScoreBAL(); ScoreBOL bol = new ScoreBOL(); bol.userid = uid; bol.time =lbltime.Text; bol.scores = lblmark.Text; bol.dates = DateTime.Now; bal.insertscore(bol); }

Categories : Asp Net



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.