w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
How to add an html control inside a div or crate a new control beside another control
var myA=document.createElement("a"); would create an element, you can set it's text by myA.innerHTML and src with myA.src="http://www.google.com" To add it to the page you can do: document.getElmentById("mydiv").appendChild(myA); to remove: var As=document.getElmentById("mydiv").getElementsByTagName("a"); var a = As[As.length-1]; a.parentElement.removeChild(a);

Categories : Javascript

Get HTML control in formview control on server
If you added html controlls with runat="server" you can access it with Request.Form[ControlName.UniqueID] otherwise, you need to add name="yourcontrol" and you will get the controls in Request.Form["YourControlName"].

Categories : Asp Net

How to apply Ext.Net V2 Combobox control on Html Input control with Combobox Applyto property?
Ext.NET 2 uses ExtJS 4.1 which dropped the support for applyTo and removed it from most components, for a combobox try the configuration property "transform" which does almost the same thing ,check the below links for more info: applyTo non exist ?? add applyTo to Ext 4.1

Categories : Javascript

Assign ImageUrl value from Image control to image html control
the key word this is not available to zoom function. Pass the current object using this, also use find instead of select. You can use closest instead of parent to find the common ancestor of image object and the button being clicked with class left. Html <input type="button" value="Resize" onclick="Zoom(this)" /> Javascript function Zoom(imgObj){ var img = $(imgObj).closest('.left').find(".imgClass"); $("#imageDialog").attr('src', img.attr('src')); } You can assign some id to your image button and bind event using jQuery then this will be available in the handler. Html <input id="mybutton" type="button" value="Resize" /> Javascript $('#mybutton').click(function (){ var img = $(this).closest('.left').find(".imgClass"); $("#imageDialog").attr('src', i

Categories : Jquery

HTML CSS Control a DIV from another DIV
If the two elements are siblings you can use the adjacent sibling combinator, e.g. <div></div> <div></div> div { background: slategray; height: 5em; width: 5em; } div + div { background: lightgray; } div:hover + div { background: peru; border-radius: 10px 50px / 20px; } http://jsfiddle.net/b5fgT/1/ Or if the elements are siblings but not immediate siblings, you can use the general sibling combinator: http://jsfiddle.net/b5fgT/3/ You can also style a descendant element when mousing over its parent: div:hover > div { /* CSS */ } Edit as per your comment: "But I want change the color of the <p> only.. Can you do it for me?" Well in that case you can use: #aboutUs:hover p {color: red;} - http://jsfiddle.net/mpa5k/1

Categories : HTML

Custom Control with inner html C#
Please find the solution below. We can use it for creating controls like rounded corner container etc. [ParseChildren(true, "Items")] [PersistChildren(true)] public class CustomContainer : Control { private List<Control> m_items = new List<Control>(); [Browsable(false)] public List<Control> Items { get { return m_items; } } protected override void CreateChildControls() { //create a custom container of our choice for your child controls HtmlGenericControl div = new HtmlGenericControl("div"); foreach (Control ctrl in Items) { div.Controls.Add(ctrl); } this.Controls.Add(div); } }

Categories : Dotnet

ASP.NET control rendering HTML attributes
You have to add those in server-code: hl1.Attributes["custom-client-side-attr"] = "1"; You can still do it in the markup - you'd have to do it prior to the the declaration: <% hl1.Attributes["custom-client-side-attr"] = "1"; %> <myControls:Hyperlink ID="hl1" runat=server custom-client-side-attr="1"></<myControls:Hyperlink>

Categories : HTML

How to make C# class know about HTML control?
By default, HTML elements within an ASP.NET file are treated as literal text and you cannot reference them in server-side code. To make these elements programmatically accessible, you can indicate that an HTML element should be treated as a server control by adding the runat="server" attribute. and Also HTML server controls must reside within a containing form tag with the runat="server" attribute. Reference: HTML Server Controls Now you can access your control from code behind but here you can't get Text property of input html control, you need to get Value property. If you convert html page to ASPX then you can replace relevant ASP.NET control with existing HTML controls. for example you can use input type text with ASP.NET TextBox control

Categories : C#

How to validate only one HTML control using jQuery
To use the example of JsFiddle, is this what you want to accomplish? $(document).ready(function() { $('.abc').bind('keyup', function() { regex = /^[A-z0-9]+$/; if(!regex.test($(this).val())) { // append the color red to the background $(this).css('backgroundColor', '#f00'); } else { // reset color to white $(this).css('backgroundColor', '#fff'); } }); });

Categories : Javascript

Is using HTML controls in asp.net effective than using asp.net control.?
If you definitely do not want to add ViewState overhead, then use HTML controls rather than ASP.NET server controls. But beware, ViewState is the glue for a lot of ASP.NET server controls being able to "remember" their values between post backs to the server. If you want more control over the output HTML, then use HTML controls, because the HTML control will map directly to the corresponding HTML element, rather than be rendered as potentially another HTML element or group of HTML elements, for example: ASP.NET Literal server control will not render as an element, but rather just text. ASP.NET GridView server control will render as an HTML table container, by default, and then literal text for BoundFields and various other elements for TemplateFields. ASP.NET CheckBoxList server control

Categories : C#

is it possible to set daynamic name for html control and handle it with php?
<form> <input type="file" class="droparea spot" name="xfile[]" data-post="upload.php" data-width="220" data-height="345" data-crop="false"/> <input type="file" class="droparea spot" name="xfile[]" data-post="upload.php" data-width="220" data-height="345" data-crop="false"/> <input type="file" class="droparea spot" name="xfile[]" data-post="upload.php" data-width="220" data-height="345" data-crop="false"/> <input type="file" class="droparea spot" name="xfile[]" data-post="upload.php" data-width="220" data-height="345" data-crop="false"/> <input type="file" class="droparea spot" name="xfile[]" data-post="upload.php" data-width="220" data-height="345" data-crop="false"/> </form> ... <?php pri

Categories : PHP

Show HTML Text in TextBlock-Control
I think you can try two different approaches: Simply display the HTML content in a WebBrowser control. This has multiple disadvantages, such as not being able to be transparent, and its performance can be quite disappointing. Convert your HTML content to XAML FlowDocument, which you can display natively in a TextBlock. You can find more information about how to convert here.

Categories : C#

call a function in c# from menu control in html
Create a separate page Logout.aspx and point the link of the logout menu item to that one. You can then use your code in the Page_Load handler of the Logout.aspx to abandon the session and redirect to the login page.

Categories : Asp Net

Binding on select html control using knockout
When passing a string to optionsText, Knockout simply tries to key into your object. It does not handle nested keys or run the string as JavaScript. However, you can instead choose to pass a function for optionsText which takes in the item as the first argument and you can return whatever value that you like. For example, in your jsFiddle, you could define a function like: self.getOptionText = function(item) { return item.dictionary.name; }; Then, bind against it like: <select data-bind="options: myCollection, optionsText: getOptionText"></select> In your sample from the question, then you would just do item.dictionary().name() if you are dealing with observables.

Categories : Javascript

Adding a redirect to a Web Control / HTML Writer
If you use HTML button (I guess < input type='button'>), then you can only interact with them using javascript. You should use window.location = url And build url to contain your id : http://mysite/myPage?Id=12 Then you may pass Id using data attributes. For example : <input type='button' data-id="12"/> then, in JS, if using jquery : var btn = ...get-your-button-by-id-or-class-name-or-whatever var id = btn.data('id'); window.location='http://mysite/myPage?Id='+id;

Categories : C#

How to get runtime id of html control sencha touch 2?
Use the getId(), that's exactly for this. Documentation here: http://docs.sencha.com/touch/2.0.2/#!/api/Ext.Button-method-getId

Categories : HTML

ASP.NET / DotNetNuke - Prepend HTML to the body from of a User Control
You might be able to use the client resource manager placeholders for this. http://www.dnnsoftware.com/wiki/Page/Client-Resource-Management-API Specifically, in the default.aspx file of your site you'll see a BodySCRIPTS placeholder. That or if you want, you might be able to target the Body ID element by getting to the Page base, I do something like that for controlling the Title of a page in https://dnnsimplearticle.codeplex.com/SourceControl/latest#cs/Controls/ArticleView.ascx.cs var tp = (CDefault)Page; tp.Title = curArticle.Title;

Categories : C#

Create a function to pass html control "ui" as paramater.
If I correctly understood what you want maybe you could try something like this. Model: public class ListItem { public string Content { get; set; } } public class ListOfItems { public int Id { get; set; } public IList<ListItem> Items { get; set; } } View (for example using razor): @model IEnumerable<ListOfItems> .... @foreach (var itemList in Model) { <ul id="ul_@itemList.Id"> @foreach(var item in itemList.Items) { <li>@item.Content</li> } </ul> } Controller: public ActionResult ViewList(){ var model = new List<ListOfItems>(); var listItem1 = new ListItem { Content = "My first list item!" }; var listItem2 = new ListItem { Content = "My second list item!" }

Categories : C#

How to render Server control Client ID in html element
Since you tagged it jQuery you can use a jQuery selector: <script> $("#<%=btn.ClientID%>").click(function() { //my stuff }); </script> Or if you still want to use OnClientClick: <asp:Button id="btn" runat="server" OnClientClick="myfunc(this, 'secondvalue', 'thirdvalue')"> <script> function myfunc(btn, val1, val2) { var buttonRef = $(btn); } </script>

Categories : Javascript

ActiveX control is not working when HTML page is hosted on IIS
Try installing the ActiveX component on the IIS server. Also check your internet zone and security settings, specifically you might try adding the site in question to your trusted sites zone.

Categories : C#

pass runat="sever" or control of asp.net value to html tags
May be this will help <form > <asp:Label ID="Label1" ClientIDMode='static' runat="server" Text="hello"></asp:Label> <input type="text" name="requestparameter" ClientIDMode='static' id="requestparameter" onclick='SetValue' ><br /> <input type="submit" name="submit" value="Submit"> </form> <script> function SetValue(){ document.getElementById('<%=requestparameter.ClientID %>').value= document.getElementById('<%=Label1.ClientID %>').innerHTML } </script>

Categories : Javascript

How to do some changes to the html control based on focus events using backbone
In updateCurrentCell, try adding a console.log message to make sure it's getting called repeatedly, and that you're not having an issue with being unable to close the alert box. But if the function keeps getting called, it's because the input field keeps regaining focus. This could happen if you have some code forcing the focus on "#input" that gets executed each time it loses focus. But without a jsFiddle reproducing the problem, it will be difficult to diagnose...

Categories : HTML

difficult with radio button control in html with javascript
After reading again, I believe I noticed something in the code. You check document.doc_copy.rad.length (radio buttons I suppose) but when you write the code to display the DIV, you use this document.getElementById(document.doc_copy.rad[i].value).style.display. I think instead of rad[i] you should have something else related to the div you want to hide/display. Thanks to Barmar I realized my answer is wrong. When you have only one radio button, your index is 0. That means that the FOR statement will not be executed at all. You need to use a DO...WHILE which ensures you will have one execution no matter what. function ChangeDiv(){ var i; var j; i = 0; do { if(document.doc_copy.rad[i].checked){ document.getElementById(document.doc_copy.rad[i].value).style.disp

Categories : Javascript

how to add picture box control and label control dynamically in list view control
Did you google around? There are lot of links that can help you http://geekswithblogs.net/dotNETvinz/archive/2009/04/24/faq-displaying-image-from-database-to-gridview-control.aspx http://weblogs.asp.net/aghausman/archive/2009/05/26/show-images-on-grid-view-from-file-stream.aspx http://www.codeproject.com/Articles/20782/Displaying-Images-from-a-Database-in-a-GridView http://www.codeproject.com/Articles/20971/Thumbnail-Images-in-GridView-using-C

Categories : Asp Net

Load HTML script and video play in WebBrowser Control in WP7
Your C# code is fine. However, your HTML code is broken. Just save it to the HTML page on some web server (your local IIS will do great), and navigate there with your windows phone's built-in Internet Explorer - you'll only see a white screen. In your HTML there's a JavaScript that does a cross-domain XMLHttpRequest. That's why the line a.open('GET', 'http://media.yesheis.com/multi_player?ids=11293&w=300&h=225&autoplay=1&provider=youtube', !0); throws an access denied exception.

Categories : C#

how to render html file in window/dialog box using activex control
The MFC library makes this rather easy. Here is a link to a sample program that uses MFC CHtmlView to create a browser: http://msdn.microsoft.com/en-us/library/ms177540(v=VS.80).aspx

Categories : C++

Copy selected item's text from select control html
As far as I know, it is not possible to mark the text of a option element. Copy text into clipboard without flash is impossible, too. This solution is not the best, but it's the simplest: <!DOCTYPE html> <body> <select> <option value="orange">Orange</option> <option value="blue">Blue</option> <option value="red">Red</option> <option value="white">White</option> </select> <input type="text"></input> </body> - $('body').on('change', 'select', function() { $('input').val($(this).find(":selected").text()).select(); }) http://jsfiddle.net/5C3Q9/2/ Just copy the text into a input field, so the user can select and copy it.

Categories : Javascript

HTML emails in 2013: How to control spacing between elements like paragraphs and images?
You need to use super specific inline CSS for emails as all the mail clients like to do their own thing when it comes to rendering the email. It can be more of a pain than, dare I say it, developing for IE! By super specific I mean, don't assume anything! Set everything explicitly.

Categories : HTML

ASP (.NET 4) ViewState enabled Literal control not retaining changes to HTML contents on PostBack
The way postback works in .NET is actually a wrapper around the more basic idea of HTML forms. A basic example of HTML forms is: <html> <body> <form action="" method="POST"> <input type="text" value="type here" /> <input type="submit" value="go" /> </form> </body> </html> Roughly, what the .NET abstraction adds is: <html> <body> <form action="" method="POST"> <input type="hidden" name="__VIEWSTATE" value="string-encoded-value" /> <input type="text" name="bob" value="type here" /> <input type="submit" value="go" /> </form> </body> </html> Whereby on postback to your page, all input elements with names are mapped back into properties of your Page object, and the __V

Categories : C#

I need to know when a report is loaded in SSRS HTML Viewer - WinForms WebBrowser Control
Instead of displaying SSRS in WebBroswer control why not use ReportViewer for WinForms? I believe it's more suitable for scenario.

Categories : HTML

Can Label get focus while tabbing when its corrsponding control is hidden in HTML Form?
Set the HTML property tabindex to a different number (such as 99) to prevent the user from focusing on an invisible element. Source: http://www.w3.org/TR/html401/interact/forms.html#h-17.11.1

Categories : Javascript

How do clear/set value of Asp.Net TextBox that has an Ajax Control Toolkit HTML Editor Extender from the client?
You can use this script: function clearHtmlExtender(){ var extender = $find("<%= htmlEditorExtender.ClientID %>"); extender._editableDiv.innerHTML = ""; extender._editableDiv_onblur(); } The short description: script above resetting content of editable div (_editableDiv.innerHTML) and then force extender to assign this hrml to target textbox.

Categories : Javascript

jQuery Automatic page scroll with HTML slider to control animation speed
Please delete these Part of your code <body onLoad="pageScroll(100000);"> And you have 2 body tags in your code... It's not good... If you want to do something, when your page is loaded, then do it in JS with helps of jQuery -> $(function() { /* things to do, after the page is loaded */ pageScroll(100000); }); To change the animation, use .stop(). It breaks all animations in queues. For more information, read API docs function pageScroll(speed) { $("html,body").stop().animate({ scrollTop: 119}, 500 ); } And i'm not sure, but i think i had some Problem with this selector... if it doesn't work, try this selector: $("html:not(:animated),body:not(:animated)")

Categories : Javascript

Audio in html page continues to play even after I exit the web browser control windows phone 8
One method is to reload the page. I guess.. Using the following method.. var js = "window.location.reload(true);"; wbcontent.InvokeScript("eval", js); But what i really do want to know is why the audio continues to play even after i have exited the web browser control.

Categories : C#

The Controls collection cannot be modified because the control contains code blocks(i.e.<% ...%>) ajax toolkit html editor
I have faced this error before. Solution is, check in your master page, if you have javascript with <% ... %> block, then remove it from head and add in body section. Hope it helps you.

Categories : Javascript

html select control click not showing options list until mouse is hovered towards the options
it seems IE9 is blocking javascript...i hope this helps http://answers.microsoft.com/en-us/ie/forum/ie9-windows_vista/internet-explorer-9-drop-down-menus-do-not-pull-up/954c5c71-5878-40a4-b9f8-68991922e85a

Categories : Javascript

Html.checkbox control form collection values are getting with some extra true false values
Its because when the check box is selected the values passed are "true,false" Using Contains("true"); You can check whether the checkbox is selected or not For eg: bool bChecked = form[key].Contains("true");

Categories : C#

Should i use Associatedcontrolid in label control to render label HTML tag?
The <label> element in html is a label for an <input> element. So the TextBox that is made as an <input> tag if it is associated with a asp:Label or ASPxLabel which is just an extention of the asp:Label will indicate to the .Net framework to translate it as a html <label> tag. In essence if you don't have a TextBox there is no point to translate the asp:Label to html tag. You had better add a new CSS class and format the span as you please if you don't want the TextBox. If you do want a TextBox, then you should add it to your ASPX file and assign to id the same ID attribute value with the AssociatedControlId value at your label.

Categories : C#

How can I use wildcards or regular expressions to control Path-based authorization / access control for svn?
as of June 2013 it is impossible to do this. So, the solution to the problem is to re-organize the repository so this isn't necessary. When a thing is too difficult it usually leads to a large rethink of the design or approach. At present maven structure leads to this requirement: root/pom.xml root/project1/pom.xml root/project2/pom.xml etc.. We can replace this with /root/pom.xml /project1/pom.xml /project2/pom.xml etc.. We can set the svn perms as follows granting all read access to the top level project and read write to their project. If an continuous integration build server populates an internal maven repo with the root snapshot then the users only need to checkout specific projects. [repo:/root] * = r @releng = rw [repo:/project1] @teamOne = rw [repo:/project2] @teamTwo =

Categories : Svn

Border doesn't inherit Control, so how does a setter on Control.Background work?
Background dependency property in WPF is shared by many classes. It is defined in the Panel class, other classes just call AddOwner on it. Border.cs [CommonDependencyProperty] public static readonly DependencyProperty BackgroundProperty = Panel.BackgroundProperty.AddOwner( typeof (Border), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.SubPropertiesDoNotAffectRender)); Panel.cs [CommonDependencyProperty] public static readonly DependencyProperty BackgroundProperty = DependencyProperty.Register("Background", typeof(Brush), typeof(Panel), new FrameworkPropertyMetadata((Brush)null, FrameworkPropertyMetadataOptions.AffectsRender |

Categories : Wpf



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