|
Hi,
I have an application (ASP.net with C#) which allows users to view 3 pages with data in GridViews. Page 1 shows GridView A, page 2 shows GridView B, and page 3 shows both A & B to allow comparison. In order to do this I have created 2 UserControls to show the GridViews.
The database is also linked to by a separate application, which may make changes while the user is viewing the data in a GridView. Therefore, I am using AJAX and have placed the GridViews inside an UpdatePanel within the UserControls.
AJAX refreshes the UpdatePanels every 5 seconds. It also refreshes the scroll position of the page.
I have managed to prevent re-setting the scroll position for the whole page by using the Page directive MaintainScrollPositionOnPostback="true" on the pages which use the UpdatePanels.
However, page 3 (the comparison page) users 2 ContentPlaceHolders, one above the other, which each display one of the UserControls. While I can prevent the whole page scroll position resetting, I can't stop the scroll position of these ContentPlaceHolders (or is it the UserControls?) resetting.
Anyone got any ideas how to do this? It's really important that my users are able to scroll through the contents of both ContentPlaceHolders to where they want them, and then look at them for more than the few seconds they get before the scroll position.
Thanks ever so much,
Alice
|
|
|
|
|
I finally decided to just along with VS.NET's Designer and use of Style for my custom web/server-side combobox component style attributes instead of ComponentStyle to store my component's main style attributes in. There were several reasons I tried to use ComponentStyle component:
1) Adding attributes with letters of different cases causes multiple enteries in the string.
2) The Designer doesn't show a default style property editor for Styles
3) You can not create a Shadowed Read/Write Property for Style, so you can't address the previous two issues.
4) A minor point, my component exposes four styles, maybe five in the future, so I wanted to make it clear which style does what. So while style is the conventional name for this property, it isn't immediately clear that it only applies to the component and not any of the sub-components, like the text-box, list-box, or the image-button.
It would be very nice if there were a way to tell the designer to use my style property, even if it isn't named Style. Also, it would be nice if in the Designer you could use the built-in style property editor for custom web/server-side components. It's not perfect, but it's better than directly editing the HTML inline style string. It would go along way to solving my issues with using Style.
Has anyone out there been able to add a style property editor to their components?
|
|
|
|
|
The following code does not solve this problem, but it does make the property visable in the VS.NET 2003 Design Property Window.
However, because it is ReadOnly it can not be edited. Also, because it is not recognized as one of the supported properties (Int, Unit, String, Boolean, etc.) the property window does not offer an editor.
Private ReadOnly Property [Style]() As System.Web.UI.CssStyleCollection
Get
Dim cbx As cwcComboBox = CType(Me.Component, cwcComboBox)
Return cbx.Style
End Get
End Property ' Style
Protected Overrides Sub PreFilterProperties(ByVal properties As IDictionary)
MyBase.PreFilterProperties(properties)
'
' Modify Style property to allow it to be seen in the properties window.
'
properties("Style") = _
TypeDescriptor.CreateProperty( _
Me.GetType(), _
"Style", _
Style.GetType(), _
CategoryAttribute.Design, _
DesignOnlyAttribute.No)
End Sub
Does anyone know what needs to be done to allow the built-in Style editor to be used with this property, or for that matter any other custom style property?
Also, I'm using CategoryAttribute.Design to make Style appear in the Design group of the property window, but help seems to indicate that you can put in in any category, including a custom one such at "Component", but it doesn't show how to do this. Anyone know how I can do this?
Thank you
|
|
|
|
|
Aloha,
I get the following exception when I try to run my program:
Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.
It occurs when I call a webmethod. The strange thing is that it fails on one machine, but no on the other.
Right now I haven't got a clue about where to search for the error, so any ideas will really be appreciated (and make both me and my chieftain happy).
Thank you,
|
|
|
|
|
It would appear as though your server is trying to output a html page where the browser or whatever is expecting an xml output.
Try modifying the headers to make the mime-type "text/xml"
Brad
Australian
I assume Microsoft would not use doors, because using Windows is faster.
|
|
|
|
|
The usual cause for this is a compilation error in the asmx page - when this ocurrs, the usual IE error page is sent down the response stream, which is text/html, rather than the XML that should be output
I'd check what is actually being returned (use a js alert() or write to a text field) - my guess is that it will be the error page, which will then tell you where the error ocurrs in the asmx...
(Or of course a Build -> Build Page should help if this is the cause)
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
It turned out that the error occured because of a call to some resources. The resources exist on the development machine, but not on production and this cause an exception to be thrown.
|
|
|
|
|
I have musical Database on my WEB site. I want to make valid links from my musical compositions to the Amazon retail of CD/DVD discs with appropriate musical composition, How can i did it ?
Thanks in advance !
Regards.
|
|
|
|
|
You can find lots of information (a 300+ page pdf file) on the Amazon associates website if I remember correctly.
It's quite easy to implement, I did http://www.cheapoo.com ages ago using the Amazon API.
|
|
|
|
|
Oops - on URL : http://www.cheapoo.com returned answer :
"The requested URL could not be retrieved"
is everything correct ?
And where actually is it : "(a 300+ page pdf file) on the Amazon associates website if " ? Did you have link ?
Thanks in advance.
|
|
|
|
|
I am creating a web site for playing music and videos.But I am not sure how to go for it.
Do I need to embed the media player in htm file and then play my media files
OR is there any other or better way to do it.
Thanks
|
|
|
|
|
You can just use the Embed tag. Like so:
<embed src="C:\Song.mp3" autostart="true" hidden="false" loop="0"></embed>
Then change the file name to any file you want to embed. And you can change the Loop to the number of times you want the Video/Audio file to repeat (or set it to "Infinite").
Keep in mind though, if you have a QuickTime video (.mov) that you want to embed in your website, the computer that is viewing the website must have QuickTime installed.
|
|
|
|
|
Encoding a video in flash has become very popular.
Brad
Australian
I assume Microsoft would not use doors, because using Windows is faster.
|
|
|
|
|
This will really depend on your goals. Is this for an Intranet or the Internet? Do you want cross platform? Do you want to protect your media content? Do you want to users to have to use a special player to see your video? Do you want the users to easily link to the video?
Assuming you don't care about protected content and you want cross platform support then use MPEGs embeded r otherwise. If you want a fine grained control over your media, but don't necessarily want to protect it, then I agree with Brad's suggestion in that Flash is quite the attractive option now.
If you go the flash route though, make sure you pick up a copy of Flash 7.0 or newer. Anything older than that will be a pain (without 3rd party plug-ins) to work with video on.
|
|
|
|
|
hi all
i want to know how to call javascript function from flash
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
yes, you must called how url (javascript url), example:
javascript:myfunction()
Flash have a function to link invoque in current navigator, this javascript function will be in current html file what the flash animation.
Cuando salga el sol, no estare aqui...
|
|
|
|
|
Used to encode a given string.
decode() -> Used to decode a given string.
sendMail() -> Used to send mail from the uniqum site.
*************************************************/
//Function to send mail from the uniqum site.
function sendMail($fromemail,$toemail,$subject,$message,$cc="",$bcc="",$accType="")
{
global $Template;
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From:"._WEBSITENAME_."<$fromemail>\r\n";
if ($cc!="")
{
$headers .= "CC: $cc\r\n";
}
if ($bcc!="")
{
$headers .= "BCC: $bcc\r\n";
}
if ($accType=='H')//Sending the mail using HTML TEMPLATE
{
$message= str_replace("TPL_CONTENT",$message,stripslashes($Template));
}
$to = $toemail;
$send = @mail($to,$subject,$message,$headers);
// echo "$send = @mail($to,$subject,$message,$headers);";
// echo " ";
}
//Function to encode a given string.
function encode($str)
{
$re_str = base64_encode($str);
$re_str = base64_encode($re_str);
$re_str = base64_encode($re_str);
$re_str = base64_encode($re_str);
$re_str = base64_encode($re_str);
return $re_str;
}
//Function to decode a given string.
function decode($str)
{
$re_str = base64_decode($str);
$re_str = base64_decode($re_str);
$re_str = base64_decode($re_str);
$re_str = base64_decode($re_str);
$re_str = base64_decode($re_str);
return $re_str;
}
?>
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
connect = mysql_pconnect($host,$dbusername,$dbpassword) or die ("Cannot connect to Database");
if($this->connect)
mysql_select_db($dbname,$this->connect) or die ("Please check the Database name");
//echo $this->connect;
}//End of constuctor function.
//Function to execute all type of queries.
function ExecuteQuery($Sql)
{
//echo $Sql;
$result = mysql_query($Sql,$this->connect) or die (mysql_error()." Please check the following query- ".$Sql);
return $result;
}
//Function to GetValue from a table.
function getTableValue($field,$table,$condition="")
{
$query = "SELECT $field as f1 FROM $table ";
if($condition<>"")
$query.=" WHERE $condition";
//echo " " . $query;
$result = $this->ExecuteQuery($query);
if(mysql_num_rows($result))
{
$row = mysql_fetch_object($result);
$f1 = $row->f1;
}
else
{
$f1 = "";
}
return $f1;
}//End of GetValue.
//Get an array of value from a table
function getTableValuesArray($table,$condition="")
{
$query = "SELECT * FROM $table ";
if($condition<>"")
$query .=" WHERE $condition";
/// echo " " . $query;
$result = $this->ExecuteQuery($query);
if(mysql_num_rows($result))
{
$row1 = mysql_fetch_array($result);
}
return $row1;
}
//Function to getComboValues from a table.
function getComboValues($name,$value,$curvalue,$table,$condition="",$caption="")
{
$query = "SELECT DISTINCT $name as f1,$value as f2 FROM $table $condition";
//echo $query;
$result = $this->ExecuteQuery($query);
$option ="";
if(mysql_num_rows($result))
{
if ($caption<>1)
{
if ($caption=="nocaption")
{
$option ="";
}
elseif ($caption!="")
{
$option ="$caption";
}
else
{
$option ="Select one";
}
}
while($row=mysql_fetch_object($result))
{
if($curvalue==$row->f2)
{
//echo " $curvalue:" . $row->f2;
$option .= "". ucwords(strtolower($row->f1)) . "";
}
else
$option .= "". ucwords(strtolower($row->f1)) . "";
}
}
return $option;
}//end of getComboValues.
//Function to insert all the data into the table.
function insertQuery($tablename,$dataArray)
{
if(is_array($dataArray))
{
$query = "INSERT INTO $tablename SET ";
$arrayCount = sizeof($dataArray);
$count = 1;
while(list($key,$val) = each($dataArray))
{
if ($count==$arrayCount)
$query .=" $key='$val'";
else
$query .="$key='$val', ";
$count ++;
}//End Of while loop
$this->ExecuteQuery($query);//Calling the execute query
}//end Of if loop
}//End of insertquery Function...
//Function to update the datas into the table.
function updateQuery($tablename,$dataArray,$condition="")
{
if(is_array($dataArray))
{
$query = "UPDATE $tablename SET ";
$arrayCount = sizeof($dataArray);
$count = 1;
while(list($key,$val) = each($dataArray))
{
if ($count==$arrayCount)
$query .=" $key='$val'";
else
$query .=" $key='$val', ";
$count ++;
}//End Of while loop
if ($condition!="")
{
$query .= " WHERE $condition ";
}//end of if
$this->ExecuteQuery($query);//Calling the execute query
}
}//End of updatequery Function...
//DELETE FUNCTION
function deleteQuery($tablename,$condition="")
{
$query = "DELETE FROM $tablename ";
if($condition!="")
{
$query .= " WHERE $condition";
}
$this->ExecuteQuery($query);//Calling the execute query
}//End Of deletequery
//Function to count the rows in a table.
function countRows($result)
{
if (is_resource($result))
{
return mysql_num_rows($result);
}
}//end of count row function.
//To get the InsertId of a table
function getInsertID()
{
return mysql_insert_id($this->connect);
}//end of getInsertID function
function getSendValuesArray($fieldArray,$table,$condition="")
{
$arguments = implode(",",$fieldArray);
$query = "SELECT $arguments FROM $table ";
if($condition<>"")
$query .=" WHERE $condition";
//echo " " . $query;
$result = $this->ExecuteQuery($query);
if(mysql_num_rows($result))
{
$row1 = mysql_fetch_array($result,MYSQL_ASSOC);
}
return $row1;
}
}//end of class db.
?>
////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
Although those are indeed very useful functions, this is a place for questions and occasionally some industry news.
I suggest you put some of that effort into an article.
Brad
Australian
I assume Microsoft would not use doors, because using Windows is faster.
|
|
|
|
|
Hi! i want to detect when a user closes browser using cross[close] button of the browser.
|
|
|
|
|
use this:
<body onunload="doFunction()">
Brad
Australian
I assume Microsoft would not use doors, because using Windows is faster.
|
|
|
|
|
is the event removed supported by IE?
|
|
|
|
|
yes
Brad
Australian
I assume Microsoft would not use doors, because using Windows is faster.
|
|
|
|
|
it is not supported by asp.net 2.0. please give an example.
|
|
|
|
|
It has nothing to do with the framework version. It's an even in the browser.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
please give me an example when this event is fired?
|
|
|
|
|