ラベル contained の投稿を表示しています。 すべての投稿を表示
ラベル contained の投稿を表示しています。 すべての投稿を表示

2012年3月28日水曜日

Resizing Tab Control to fit contained controls

Hi all,

I must be missing something, but I am having a problem with getting my tab control to fit around all the contained controls. What I am doing is adding some controls during runtime and trying to get them to fit within the tab contained area. So for example:


I have a tab control that contains functionality to search by attribute from a data table. So there are 2 combo boxes, a text box, and a button. When the user selects a value from the combo boxes and enters a value in the text box, then they can press find. When they press find, I set the datasource on a grid to reflect this query and display the grid. The problem is that my grid is being displayed outside of the colored area of my tab control. I am having this same difficulty when I add an accordion of grids to another tab.

I would appreciate any help someone can give me on this subject. I have tried changing my style sheet to include padding settings, but that didn't seem to work (though I may have not set something correctly there).

Thanks in advance.

Hello all,

I recently made a post, but I can't seem to find it now. So sorry for the redundancy of this question.

I have a tab control that I am dynamically adding an accordion to with grids inside each level of the accordion. My problem is that my tab control does not visiby resize to contain the controls that I am dynamically adding to it. Can someone give me an idea on what I might can do to force the tab to redraw to visibly contain these controls? Please tell me if this doesn't describe the problem well enough and I will try to do a better job.

Thanks,
Lee

2012年3月24日土曜日

rjs Popcalendar in UpdatePanel

I've got a web page that allows users to enter X number of people for an application. I have an asp:Table contained in an UpdatePanel. The trigger for the UpdatePanel is a dropdown list that is used to select the number of people the user wishes to enter (1-14). On the initial page load only the 1st row in the asp:Table is visible and when the user selects how many people to enter I use an AJAX call to hide/show the appropriate asp:Table rows. Each row in the asp:Table contains a rjs:Popcalendar to select the date of birth. All the Popcalendar controls work fine if all the rows are set to Visible="true" on the initial page load. However, any row that has Visible="false" on the initial page load and is set to visible via the AJAX call gives the following error when the Popcalendar is clicked: Error: 'calResidentDOBX' is undefined

It appears that the page is only aware of the Popcalendar controls in the rows that are initially visible when the page loads. How can I make the page aware of the Popcalendar controls for the rows being set to Visible="true" in the AJAX call?

Thanks

Hi,

It's a javascript object undefined error,I think the simplest way to fix it is:

checking if there is a html control with it's ID set to "calResidentDOBX",

if there is no such control,the ASPX doesn't produce the right HTML,so check your logic in the behind-code.

if there is a such control,Try this:document.getElementById("calResidentDOBX")

debuging the javascript functions to see why the object is undefined.

Thanks


Hi,

I think the cause is:

When you set some controls's Visible="false" on the initial page load,ASPX doesn't generate HTML code for these controls. ASPX just generate HTML code for them when their Visible been set to "true" in Asynpostbacks.

But these controls cann't be accessed in javascript just use their IDs,you must use document.getElementById("ID") to access them.

Thanks


Download the new version from this urlhttp://es.geocities.com/ricaj0625

Use the libraryRJS.Web.WebControl.PopCalendar.Ajax.Net.dlland the javascripts in the directoryPopCalendar2005AjaxNet.

This version support ASP.NET AJAX from Microsoft

Saludos,

Ricaute


I'm not able to get the RJS popup calendar to work.

Not sure I know how to do the following steps properly:

Is it possible to break these steps down further? Thanks

5. Add RJS.Web.WebControl.PopCalendar.dll to the project Reference

6. Add RJS.Web.WebControl.PopCalendar.dll to the toolbar


Thanks. The popup calendar is working.

2012年3月21日水曜日

roundedcornersextender destroys size settings for contained Windows Media Player

All --

Please help.

I have a Ajax RC1 and VS.NET 2005 SP.

I have a roundedcornersextender applied to a Panel.

Inside the Panel, I have a Literal.

Based on an event firing, I load the Literal with an <object> tag that is a Windows Media Player control, dynamically set with all properties including height and width.

When the page loads, the Media Player is shown but its size is the size of the video playing, not the size set in the <object> tag.

Viewing the source of the page at run-time shows that the <object> tag does, in fact, have the custom settings 640x480, but the Media Player is being displayed on the page as 1024x768.

If the Literal is NOT in the Panel (and thus does not come into contact with the roundedcornersextended) then the Media Player is sized properly, 640x480, as set in the <object> tag.

Ideas?

Thoughts?

Guesses?

Please advise.

Thank you.

-- Mark Kamoski

It sounds very strange that?the Media Player is shown as the size which is the size of the video playing, not the size set in the <object> tag.I once testedajax:RoundedCornersExtenderand didn't find this issue.Maybe this issue is caused by Media Player control. Try to place it outside of a asp:UpdatePanel and check if it works. Can you post some codes here? We'd like to test it.
Here are my simple testing codes about Ajax:RoundedCornersExtender.
<div>
<asp:Panel ID="pnlRoundedCorner" runat="server" BackColor="LimeGreen">
<table>
<tr><td id="RoundedCorner">Rounded Corner Rectangle:<asp:TextBox ID="TBRoundedCorner" runat="server"></asp:TextBox></td></tr>
</table>
</asp:Panel>
<Ajax:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" TargetControlID="pnlRoundedCorner" Radius="60"></Ajax:RoundedCornersExtender>
</div

Ji Cheng Wang - MSFT:

It sounds very strange that the Media Player is shown as the size which is the size of the video playing, not the size set in the <object> tag.I once testedajax:RoundedCornersExtenderand didn't find this issue.Maybe this issue is caused by Media Player control. Try to place it outside of a asp:UpdatePanel and check if it works. Can you post some codes here? We'd like to test it.
Here are my simple testing codes about Ajax:RoundedCornersExtender.
<div>
<asp:Panel ID="pnlRoundedCorner" runat="server" BackColor="LimeGreen">
<table>
<tr><td id="RoundedCorner">Rounded Corner Rectangle:<asp:TextBox ID="TBRoundedCorner" runat="server"></asp:TextBox></td></tr>
</table>
</asp:Panel>
<Ajax:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" TargetControlID="pnlRoundedCorner" Radius="60"></Ajax:RoundedCornersExtender>
</div

OK.

I built a sample and posted it online, with all the source code, here...

http://www.WebLogicArts.com/DemoWindowsMediaPlayerAjax.aspx

...so that demonstrates the issue.

As you will see...

I have 2 cases there, one with Ajax and one without.

I have 2 Literals there, one inside a roundedcornersextender and one that is not.

I load each Literal with the exact same <object> tag code, which is Windows Media Player (WMP).

Without Ajax, the video does load in "small size", as specified by the <object> tag, where WMP's height and width is set.

With Ajax, the video does NOT load in "small size", as specified by the <object> tag, where WMP's height and width is set.

And so on.

Please let me know what you think.

Thank you.

-- Mark Kamoski


Just in case my site is down, here is the code...

........CodeInfrontBegin

<%@. page language="C#" autoeventwireup="true" codefile="DemoWindowsMediaPlayerAjax.aspx.cs" inherits="DemoWindowsMediaPlayerAjax" %>

<%@. register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<%@. register assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI" tagprefix="asp" %>
<%@. register tagprefix="wla" tagname="codeviewercontrol" src="http://pics.10026.com/?src=CodeViewerControl.ascx" mce_src="CodeViewerControl.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="MainHead" runat="server">
<title>WebLogicArts Demo</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1" />
<meta content="C#" name="CODE_LANGUAGE" />
<meta name="vs_defaultClientScript" content="JavaScript" />
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" />
</head>
<body style="font-size: small;">
<form id="Form2" method="post" runat="server">
<asp:scriptmanager id="ScriptManager1" runat="server">
</asp:scriptmanager>
<asp:roundedcornersextender id="RoundedCornersExtender1" runat="server" behaviorid="RoundedCornersExtenderBehavior1" radius="10" targetcontrolid="Panel1">
</asp:roundedcornersextender>
<hr />
<h5>
Attention</h5>
<ul>
<li>NOTICE: THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. THIS CODE MAY BE COPIED, ALTERED, QUOTED, AND USED FREE OF CHARGE. </li>
</ul>
<hr />
<h5>
Introduction</h5>
<ul>
<li>This sample has been provided courtesy of <asp:hyperlink id="Hyperlink1" runat="server" navigateurl="http://www.weblogicarts.com/" target="_blank">WebLogicArts.com</asp:hyperlink>.</li>
<li>If you have any comments or questions, please <asp:hyperlink id="Hyperlink2" runat="server" navigateurl="mailto:MKamoski@.WebLogicArts.com" target="_blank">send some feedback</asp:hyperlink>.</li>
<li>For more C#.NET 2.0+ samples, please <asp:hyperlink id="Hyperlink3" runat="server" navigateurl="DemoList.aspx" target="_blank">see the complete C#.NET Demo List</asp:hyperlink>.</li>
<li>For VB.NET 1.0+ samples, please <asp:hyperlink id="Hyperlink4" runat="server" navigateurl="http://vb2.WebLogicArts.com/" target="_blank">see the complete VB.NET 1.0+ Demo List</asp:hyperlink>.</li>
<li>For VB.NET 2.0+ samples, please <asp:hyperlink id="Hyperlink5" runat="server" navigateurl="http://vb1.WebLogicArts.com/" target="_blank">see the complete VB.NET 2.0+ Demo List</asp:hyperlink>.</li>
<li>To browse all the code available <asp:hyperlink id="Hyperlink6" runat="server" navigateurl="CodeBrowserForm.aspx" target="_blank">see the CodeBrowserForm</asp:hyperlink>.</li>
</ul>
<hr />
<h5>
Purpose</h5>
<ul>
<li>The purpose of this demo is to present some code that shows a current issue (as of 2007-Jan-06) that I am having with Ajax and Windows Media Player (WMP). When WMP is loaded without Ajax, it is sized properly. When WMP is loaded with Ajax (inside a roundedcornersextender), it is not sized properly. See the code for details.</li>
</ul>
<hr />
<h5>
Code</h5>
<p>
<wla:codeviewercontrol id="MainCodeViewerControl" runat="server"></wla:codeviewercontrol>
</p>
<hr />
<h5>
Demo</h5>
<asp:textbox id="TextBox1" runat="server" width="500px" height="50px" wrap="true" textmode="multiLine" readonly="false">http://www.WebLogicArts.com/Downloads/Test1.wmv</asp:textbox>
<br />
<br />
<asp:button id="Button1" runat="server" text="Load Video" onclick="Button1_Click" />
<h5>
Without Ajax...</h5>
<asp:literal id="Literal1" runat="server"></asp:literal>
<br />
<br />
<h5>
With Ajax...</h5>
<asp:panel id="Panel1" runat="server" backcolor="Silver">
<table cellpadding="10" cellspacing="0">
<tr>
<td>
<asp:literal id="Literal2" runat="server"></asp:literal>
</td>
</tr>
</table>
</asp:panel>
<br />
<br />
<hr />
</form>
</body>
</html>

........CodeInfrontEnd

........CodeBehindBegin

 
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// This class is
/// </summary>
/// <remarks>
/// ----------------------
/// NOTICE: THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT
/// WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING
/// BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY
/// AND/OR FITNESS FOR A PARTICULAR PURPOSE. THIS CODE MAY BE
/// COPIED, ALTERED, QUOTED, AND USED FREE OF CHARGE.
/// ----------------------
/// To run this code, one may need make alterations as follows:
/// In the code-infront, remove the "@. Register" line (if it exists) because it is only needed for the CodeViewer control.
/// In the code-infront, remove the "wla:codeviewercontrol" line (if it exists) because it is only needed for the CodeViewer control.
/// </remarks>
public partial class DemoWindowsMediaPlayerAjax : System.Web.UI.Page
{
/// <summary>
/// This method is the event handler for page-load.
/// </summary>
/// <param name="sender">This is the event source.</param>
/// <param name="e">These are the event arguments.</param>
protected void Page_Load(object sender, System.EventArgs e)
{
try
{
//Continue.
}
catch (Exception ex)
{
this.Response.Write(ex.ToString());
}
}
 /// <summary>
/// This method is the event handler for button-click.
/// </summary>
/// <param name="sender">This is the event source.</param>
/// <param name="e">These are the event arguments.</param>
protected void Button1_Click(object sender, EventArgs e)
{
try
{
string mySourceUrl = this.TextBox1.Text;
bool isFullSize = false;
string myObjectTag = this.GetWmaObject(mySourceUrl, isFullSize);
this.Literal1.Text = myObjectTag;
this.Literal2.Text = myObjectTag;
}
catch (Exception ex)
{
this.Response.Write(ex.ToString());
}
}
 /// <summary>
/// This is a helper that will get the object tag code needed.
/// </summary>
/// <param name="sourceUrl">This is the URL of the video to be loaded.</param>
/// <param name="isFullSize">This is a flag indicating if the video should be show full-size (true) or a default-size (false).</param>
/// <returns></returns>
private string GetWmaObject(string sourceUrl, bool isFullSize)
{
string myObjectTag = "";
sourceUrl = sourceUrl + "";
sourceUrl = sourceUrl.Trim();
  if (sourceUrl.Length > 0)
{
//Continue.
}
else
{
throw new System.ArgumentNullException("sourceUrl");
}
  string myWidthAndHeight = "";
  if (isFullSize)
{
myWidthAndHeight = "";
}
else
{
myWidthAndHeight = "width='210' height='280'";
}
  myObjectTag = myObjectTag + "<object classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' id='player' " + myWidthAndHeight + " standby='Please wait while the object is loaded...'>";
myObjectTag = myObjectTag + "<param name='url' value='" + sourceUrl + "' />";
myObjectTag = myObjectTag + "<param name='src' value='" + sourceUrl + "' />";
myObjectTag = myObjectTag + "<param name='AutoStart' value='true' />";
myObjectTag = myObjectTag + "<param name='Balance' value='0' />"; //-100 is fully left, 100 is fully right.
myObjectTag = myObjectTag + "<param name='CurrentPosition' value='0' />"; //Position in seconds when starting.
myObjectTag = myObjectTag + "<param name='showcontrols' value='true' />"; //Show play/stop/pause controls.
myObjectTag = myObjectTag + "<param name='enablecontextmenu' value='true' />"; //Allow right-click.
myObjectTag = myObjectTag + "<param name='fullscreen' value='" + isFullSize.ToString() + "' />"; //Start in full screen or not.
myObjectTag = myObjectTag + "<param name='mute' value='false' />";
myObjectTag = myObjectTag + "<param name='PlayCount' value='1' />"; //Number of times the content will play.
myObjectTag = myObjectTag + "<param name='rate' value='1.0' />"; //0.5=Slow, 1.0=Normal, 2.0=Fast
myObjectTag = myObjectTag + "<param name='uimode' value='full' />"; // full, mini, custom, none, invisible
myObjectTag = myObjectTag + "<param name='showdisplay' value='true' />"; //Show or hide the name of the file.
myObjectTag = myObjectTag + "<param name='volume' value='50' />"; // 0=lowest, 100=highest
myObjectTag = myObjectTag + "</object>";
  return myObjectTag;
}
}
 
........CodeBehindEnd