w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Why JScrollBar doesn't respond to arrow keystrokes when coexist with editable component?
This is because JTextArea is stealing your key strokes: textPane.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), "pressed RIGHT"); textPane.getActionMap().put("pressed RIGHT", rightMove); Have a look at BasicTextUI.installKeyboardActions()

Categories : Java

AJAX code for calling code-behind method from aspx page doesn't work
try this: in your anchor do this: <a href="javascript:void(0)" id="kontakt">Go to Kontakt</a> and modify your ajax script to this: $('a').click(function (e) { var data = { 'id': $(this).attr("id") }; var dataVal = JSON.stringify(data); $.ajax({ type: "POST", url: "Default.aspx/loadNewPage", contentType: "application/json; charset=utf-8", data: dataVal, dataType: "json", success: function (id) { } }); });

Categories : Javascript

button enable not working on code behind on aspx page
try this: i think this will work... protected void btnSubmit_Click(object sender, EventArgs e) { if (Page.IsValid) { btnSubmit.disabled= true; btnNext.disabled= false; } or you can also try: btnSubmit.Attributes["disabled"] = "disabled"; hope this will help you.

Categories : Asp Net

asp.net code-behind doesn't see an object declared in aspx page and causes build error
If you are using a web application or some how have a .designer.cs file for your aspx page, you need to make sure your panel is added to your designer file, now that in most cases is automatically generated by the visual studio, but there is no harm to type it manually in some cases.

Categories : Asp Net

How to use breakpoints in Javascript code in .ASPX page of Visual Studio 2008
If you put a debugger; statement and you're using IE, the browser will throw a "Script Debugging" error and prompt you for a debugging tool, you can select VS 2008 from the list. Make sure to have the "Disable Script Debugging" options in IE unchecked. Alternatively, you can use "Debug > Attach To Process" and attach the debugger to your browser processes, after that you can put a regular break point from visual studio on your javascript code and it will work.

Categories : C#

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#

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

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 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

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#

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

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

Add a module to a component , but not every page of the component
One method would be to set the module to be hidden on that page using CSS. Go to views/view_name/tmpl/default.php and within the tags at the top, add the following code in: $doc = JFactory::getDocument(); $doc->addStyleDeclaration(" #element_id { display: none; } "); You will need to inspect the module using a tool such as Firebug, Chrome Dev Tools or another tool depending on which browser you're using, and change element_id to whatever suits your needs. Hope this helps

Categories : Joomla

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#

$.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

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#

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

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#

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#

Can't view .aspx page in my MVC 3 Web Application
You're using WebForms for this page, not MVC, so View() will not work. It's perfectly legal to have a WebForms page in your app, but you can't get to it the MVC way. It seems you can't put a WebForms page in your Views directory, and even if you could, you shouldn't. You'll need to put it elsewhere in your web app - let's say /HomePages Then you'll just have to do a straight-up redirect, like: public ActionResult Admin() { return Redirect("~/HomePages/Admin.aspx"); }

Categories : Asp Net Mvc

Authorizing a single aspx page with log in
In web.config, you could define elements (after system.web closure) where you set a specific configuration for a specific zone/page of your app. Eg: <configuration> <system.web> .... </system.web> <location path="Foo.aspx"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> </configuration> There, you may set a different authorization mode than the one in use by your app. With the above example, your page won't be protected by the standard authorization mode configured globally, but you have the choiche to protect your page in a custom way, directly in the page itself.

Categories : C#

Command Arguments in aspx page
You can. Eval(...) is returning object. So I would try CommandArgument='<%# string.Format("{0}#{1}", Eval("CompanyProfileGUID"), Eval("DeploymentGUID")) %>'

Categories : Asp Net

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

Calling Controller from aspx page
I found out the answer and posting here if it helps anyone. I added another class called ReportManager, which the aspx code behind calls to execute the requests. The ReportManager simulates the Controller call through this code: var routeData = new RouteData(); routeData.Values["controller"] = "Report"; routeData.Values["action"] = "SomeAction"; routeData.Values["SomeRouteValueKey"] = "someroutevalue"; var requestContext = new RequestContext(new HttpContextWrapper(HttpContext.Current), routeData); IController controller = DependencyResolver.Current.GetService<ReportController>(); controller.Execute(requestContext);

Categories : C#

pass on list from cs to aspx page
Try this, code in .cs Person p1 = new Person() { name = "Tom" }; Person p2 = new Person() { name = "Ed" }; List<Person> lijst = new List<Person>(); lijst.Add(p1); lijst.Add(p2); persons = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(lijst); javascript in aspx var persons = eval('<%= persons%>'); //this will show "Tom" alert(persons[0].name);

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

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

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

Using aspx page as partial view in MVC 4
You could use jQuery to get the response of the aspx page and then insert it into a div element: $.ajax({ url: "location/of/aspxpage.aspx", }).done(function ( data ) { $("#divElement).text(data) }); You may have to do something funky to get the html displaying correctly - take a look at http://api.jquery.com/html/ for some help with that

Categories : C#

pass value from ashx to aspx page
try this in aspx page <div> <script type="text/javascript"> function get_look_suggs(key, cont) { var script_name = 'Search_CS.ashx'; var params = { 'q': $("#<%=txtSearch.ClientID%>").val() } $.get(script_name, params, function (obj) { // obj is just array of strings var res = []; for (var i = 0; i < obj.length; i++) { res.push({ id: i, value: obj[i].Name }); } // will build suggestions list cont(res); }, 'json'); } $(document).ready(function () { $("#<%=txtSearch.ClientID%>").autocomplete({ ajax_get: get_look_suggs }); }); </script> <asp:TextBox ID="txtSearch" runat="server"&g

Categories : Asp Net

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

asp.net mvc 3 routing aspx page from controller
Check out this walkthrough on how to set up routing for Asp.Net Web Forms: http://msdn.microsoft.com/en-us/library/dd329551.aspx I think the easiest way to get this working is to modify your aspx-page to check both Request.QueryString and Page.RouteData.Values for the same values, possibly with a preference for the QueryString values.

Categories : C#

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#

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#

Sending a C# string to aspx.NET page
If the string is a protected (at least) property on the page then it can be accessed in the page's markup. So the string would be something like this at the class level: protected string MyString { get; set; } And in the page markup you can access its value: <%= MyString %>

Categories : C#

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



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