.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

changing the control position

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :ASP.Net
 

How can i change control position in aspx page at runtime Is it possible through xml / xslt  files
with out re-depoying the code.Any sample code / links
Please help me out 




View Complete Post


More Related Resource Links

How to position one control relative to another one even after resizing windows?

  

I used following Jquery code trying to make image close to a table. It worked fine after first load, but the position changed after window is resized. Any ideas? thanks

$(document).ready(function() {
            var pos = $("#mytable").offset();
            var width = $("#mytable").width();
            var left = pos.left + width + 20;
            var top = pos.top + 200;
            $("#ctl00_ContentPlaceHolder1_imgPreview").css({
                position: 'absolute',
                zIndex: 5000,
                left: left,
                top: top
            });
        });


changing records frm control in update panel

  

i have a list box, a command button and a grid

when i click a particular record / or multiple records on the  list box and then cclick the command button the records r transferred 2 the grid

i also have custom paging, the paging shld ocur as many times i clcik the command button

i have used updatepanel with the command button in it so that partial postback ocurs or there is no page flicker ,

but when i use update panel i get teh records in the grid but custom page is not working . it has no affect even if the records are added

if i remove update panel the paging works properly

how do i manage it with update panel


How do I get the ordinal position of a control without knowing, and more importantly, not needing to

  
Hello, How do I get the ordinal position of a control without knowing, and more importantly, not needing to know it's parent type? For example, this XMAL: <Parent of unknown type>      <Control Name="Control_1" />      <Control Name="Control_2" />      <Control Name="Control_3" />      <Control Name="Control_4" /> </Parent of unknown type> How do I get "Control_3"s ordinal position within its parent control? I know that I can do this:     UIElement p = (UIElement)Control_3.Parent; or even:     FrameworkElement p = (FrameworkElement)Control_3.Parent; but neither of those allow:     int i = p.Children.IndexOf(Control_3); nor     int i = p.Items.IndexOf(Control_3); If the parent is a StackPanel, I can do:     StackPanel p = (StackPanel)Control_3.Parent; and then I can do:     int i = p.Children.IndexOf(Control_3); I really do not want to have to cast the parent to a specific type, that would be a pain since there several types that could have children or items. Regards, Robert

DataBinding not updating underlying business object when changing control property from code

  

I have a custom data form control that in code generates databindings between the selected custom business object (LLBL) and the various controls on the screen. Everything works in that I set the DataContext to the selected business object and the data appears in the GUI. If the user changes anything on screen, the data is getting updated into the business object.

However, now I have some custom logic that when the user presses a button I need to update some fields. Currently I'm setting this data directly into the controls, setting the new value into the property that is bound. However, the data is not getting pushed back into the business object.  I had this same issue building WinForm apps in that databinding only fired if the user was in the control and left it.

Does the same thing apply to WPF? How can I get ANY change on say a TextBox's Text property whether via user interaction or from C# code to push that value into the bound business object property?

 


Get Control screen position from a MVVM View Model (not using CodeBehind in the control)

  

Hi, I am using a MVVM pattern for a WPF UserControl. I need to be able to position a dialog over the top of the control, so I need the top left screen coords for the control.

IF, I was to use code behind, the following seems to do the job..

 private void UserControl_MouseDoubleClick(object sender, MouseButtonEventArgs e)
  {
   Point controlPos = PointToScreen(new Point(0, 0));
   ...
   }

The controlPos above seems to give the correct result. However, is there anyway of doing this without having to use any code behind in the actual control (eg have the code purley perhaps in the View model class, of have something in the Controls XAML?

Thanks in advance for any help

regards

Peter


Changing the cursor Position

  

Hello all,
On Image Click how to move the mousecursor position in web application???

In case of windows application on button_click i have written the following code:


Point p = new Point();
p.X = 41;
p.Y = 400;
Cursor.Position = p;

This works fine & cursors position also change.

but how to do that on aspx page or in web application?????

In my case on Image click i have to move the cursors position.

But I have to move the cursor with clienside script i.e Java Script . How to do that????
Any help
will be appreciated.

Thanks in advance,
Regards,

Chandrakant Tale.


dynamic javascript of an .ascx control inside an updatepanel not changing on client between async po

  

I have a confusing state issue. I found a way around it, but I would like to know why this is happening. First of all, I am using .NET 3.5 and that can't change right now (an easy fix may be the fixed ID capabilities of .NET 4.0).

Type csType = this.GetType();
ClientScriptManager cs = Page.ClientScript;
string jScriptBlockName = "SignUpSignInNameAvailabilityScript";
if (!cs.IsClientScriptBlockRegistered(csType, jScriptBlockName))
{   //NOTE: verified code always enters this
    StringBuilder cstext2 = new StringBuilder();
    cstext2.Append("function GetSignUpSignInNameAvailabilityMessage() { var id = '"
          + CreateUserWizardStep1.ContentTemplateContainer.FindControl("iSignUpSignInNameAvailabilityMessage").ClientID
          + "'; alert(id); return id; }");
    cs.RegisterClientScriptBlock(csType, jScriptBlockName, cstext2.ToString(), true);
}

This code is in Page_Load of an ascx. The same control is drawn on two separate postbacks of an UpdatePanel in different places of the page thus giving them different client IDs. The code works correctly on the first refresh of web browser; but after UpdatePanel

UpdatePanel Reference in control.ascx.designer.cs keeps changing

  

I have an annoying problem when I'm developing in Visual Studio 2010. I am using an UpdatePanel in my .ascx file like this:

<asp:updatepanel id="upStuff" runat="server">....</asp:updatepanel>


in my control.ascx.designer.cs, the update panel is being defined like this:

protected global::System.Web.UI.WebControls.WebParts.updatepanel upSettings;


this produces the error:

"The type or namespace name 'updatepanel' does not exist in the namespace 'System.Web.UI.WebControls.WebParts' (are you missing an assembly reference?)"


The actual namespace should be System.Web.UI.UpdatePanel. When I go directly into the designer.cs file and change it, it works. However, every time I go back into editing control.ascx and save, Visual Studio always changes it back to System.Web.UI.WebControls.Webparts.updatepanel.

I'm not sure what is causing this. Is it how I should be referencing namespaces and classes in my project? I'm using .NET 3.5. Any help would be greatly appreciated.


Dynamically Changing ImageUrl in HyperLink control

  

Hey guys,

C#/.net newb alert. ;)


I'm writing a script and need help with being able to modify the ImageUrl property in a HyperLink control from the code behind page. It is meant to dynamically show an image.


I just need to know the correct format of the code behind to get this to work.


Thanks


Changing tab control appearance

  

Hi,

I'm trying to customize the appearance of the WPF tab control.  There are several examples I've run across on the web (1, 2) and MSDN's TabControl style and template page.  I even dumped out the Tab control's default template by using the 'Dumping the Defaults' routine described in Petzold's MSDN article and then apply that template to a tab control.   

All of the above work to customize the appearance of the tab control.  However, all suffer from some strange behaviour when the template is applied in VS WPF designer.  Here's the XAML skeleton I used for my testing:

<Window x:Class="TabControlTest.MainWindow"
    xmlns=

Changing a control attribute at runtime.

  

Hi Guys,

I'm basically trying to get a div containing a loading gif to show on my page at runtime. I call it from a button click event as well as in the code flow. It was working before I used the AJAX Update Panels. I've since taken them out as they were causing issues with RegisterClientScriptBlock. By the way, does commenting out the AJAX Markup like this...

<%--           <asp:UpdatePanel ID="up_search" runat="server">
                            <ContentTemplate>--%>

...remove them from influence?
 
My div markup looks like this..
<div id="loading" style="visibility: hidden;" runat="server">
    <img id="loading_gif" alt="Loading..." class="loading" src="Images/panel_loading.gif" />
</div>

My code is initiated from the button click event.

    protected void btnSearch_Click(object sender, EventArgs e)
    {
        //ChangeCursor("wait");
        //up_prcss.Update();
        //up_search.Update();

        //show the loading image

Changing tab control appearance

  

Hi,

I'm trying to customize the appearance of the WPF tab control.  There are several examples I've run across on the web (1, 2) and MSDN's TabControl style and template page.  I even dumped out the Tab control's default template by using the 'Dumping the Defaults' routine described in Petzold's MSDN article and then apply that template to a tab control.   

All of the above work to customize the appearance of the tab control.  However, all suffer from some strange behaviour when the template is applied in VS WPF designer.  Here's the XAML skeleton I used for my testing:

<Window x:Class="TabControlTest.MainWindow"
    xmlns=

is there any way to know the position of my cursor - in TextBox control ?

  
hi

i have in my C# (WinForms) program TextBox control

if i have this text in: `abcd efg hijklmnop`

and i stand with my cursor between `c` and `d`  = position 3

or i stand with my cursor between `h` and `i`  = position 10

how to get this position ?

thank's in advance

Changing Z-index order programmatically in C# with Control.SetChildIndex?

  
Hello developers.

I've recently build a Windows form app that contains 18 pictureboxes and 1 button.
I want the boxes on the bottom of the form to be on the front, so they overlap all the others.
And the boxes on the top of the form must be on the back, so they are behind all the others.

I can manually do this with 'move to front' and 'send to back' options, but I want to to this programmatically.
This is so, because I'm gonna add another picturebox that can move.
That picturebox should automaticly change it's z-index when it's Y changes.

At the moment the 17 pictureboxes have a random 'z order':
Some pictureboxes are on top, some are on the bottom, in a random way.
Now I want to set the z order correctly when I click on the button.

I've made code that sets the ChildIndex between 1 and 5 depending on the Y of the picturebox.
When the Y = 0, the ChildIndex will be 5, and when the Y = 400, the ChildIndex will be 0.
The pbBackground is also a picturebox, and this one's ChildIndex = 10.

My problem is, that my Windows form app isn't doing what it's supposed to be.

The picturebox names are pictureBox0, pictu

Changing the graphics on the home page of a SharePoint site

  
When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

  
In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Accessing the different controls inside a GridView control

  
how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend