|
Thanks,
"I didn't understood this. How come a value stored in session changes when user logs in?"
yep that's right for some reason I thought so
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
Hello
I have an ImageMap created using YDreams ImageMapDemo 2.0. I'm using this control for the rollover image effect with circle and polygons hotspots. My issue is I can't seem to figure out how to write the correct C# code for each hotspot. I am able to get one hotspot to have the rollover effect but not the other 4. Can someone please help me out with the code behind. I am very very new with C#. Anyone's help would be much appreciated. Been banging my head for 2 months.
Thanks in advanced
Dale
Form code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ Register Assembly="YDreams.Web.UI.WebControls" Namespace="YDreams.Web.UI.WebControls"
TagPrefix="ydreams" %>
<!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 runat="server">
<title></title>
<script type="text/javascript">
function pageLoad() {
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
</div>
<div>
<ydreams:ImageMap ID="ImageMap1" ImageUrl="methodology_circle_green.gif" OnClick="ImageMap1_Click" runat="server">
<ydreams:CircleHotSpot CenterX="210" CenterY="45" Description="Click to test post back..."
HotSpotMode="Navigate" Radius="41" ToolTip="Post back" Id="AssessCircle" />
<ydreams:CircleHotSpot CenterX="310" CenterY="120" Description="Click to test post back..."
HotSpotMode="Navigate" Radius="41" ToolTip="Post back" Id="AnalyzeCircle" />
<ydreams:CircleHotSpot CenterX="270" CenterY="240" Description="Click to test post back..."
HotSpotMode="Navigate" Radius="41" ToolTip="Post back" Id="ArchitectCircle" />
<ydreams:CircleHotSpot CenterX="145" CenterY="240" Description="Click to test post back..."
HotSpotMode="Navigate" Radius="41" ToolTip="Post back" Id="AssembleCircle" />
<ydreams:CircleHotSpot CenterX="103" CenterY="120" Description="Click to test post back..."
HotSpotMode="Navigate" Radius="41" ToolTip="Post back" Id="AssimilateCircle" />
</ydreams:ImageMap>
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
</div>
</form>
</body>
</html>
C# Code Behind
using System;
using System.Data;
using System.Configuration;
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;
using System.Text;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
YDreams.Web.UI.WebControls.HotSpot AssessCircle = new YDreams.Web.UI.WebControls.CircleHotSpot(210, 45, 41);
{
ImageMap1.HotSpots.Add(AssessCircle);
{
YDreams.Web.UI.WebControls.CircleHotSpot circleHotSpot = (YDreams.Web.UI.WebControls.CircleHotSpot)this.ImageMap1.HotSpots["AssessCircle"];
{
circleHotSpot.Attributes.Add("onMouseOver", "javascript:DisplayImage(image2);");
circleHotSpot.Attributes.Add("onMouseOut", "javascript:DisplayImage(image1);");
}
string script = @"
var image1 = new Image(413, 285);
image1.src = 'methodology_circle_green.gif';
var image2 = new Image(413, 285);
image2.src = 'methodology_circle_blue_assess.gif';
function DisplayImage(image) {
var theImage = document.images['ImageMap1'];
if (!theImage) {
theImage = document.getElementById('ImageMap1');
}
theImage.src = image.src;
return true;
}
";
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "DisplayImage", script, true);
}
}
YDreams.Web.UI.WebControls.HotSpot AnalyzeCircle = new YDreams.Web.UI.WebControls.CircleHotSpot(310, 120, 41);
{
ImageMap1.HotSpots.Add(AnalyzeCircle);
{
YDreams.Web.UI.WebControls.CircleHotSpot circleHotSpot = (YDreams.Web.UI.WebControls.CircleHotSpot)this.ImageMap1.HotSpots["AnalyzeCircle"];
{
circleHotSpot.Attributes.Add("onMouseOver", "javascript:DisplayImage(image2);");
circleHotSpot.Attributes.Add("onMouseOut", "javascript:DisplayImage(image1);");
}
string script = @"
var image1 = new Image(413, 285);
image1.src = 'methodology_circle_green.gif';
var image2 = new Image(413, 285);
image2.src = 'methodology_circle_blue_analyze.gif';
function DisplayImage(image) {
var theImage = document.images['ImageMap1'];
if (!theImage) {
theImage = document.getElementById('ImageMap1');
}
theImage.src = image.src;
return true;
}
";
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "DisplayImage", script, true);
}
}
}
protected void ImageMap1_Click(object sender, YDreams.Web.UI.WebControls.ImageMapClickEventArgs args)
{
YDreams.Web.UI.WebControls.HotSpot hotSpot = args.HotSpot;
int x = args.X;
int y = args.Y;
this.Label1.Text = string.Format("Clicked on hot spot \"{0}\" at image coordinates ({1}, {2})", hotSpot.Id, x, y);
}
protected void Button1_Click(object sender, EventArgs e)
{
this.Label1.Text = string.Empty;
}
}
modified on Friday, July 31, 2009 8:20 PM
|
|
|
|
|
dmgroup1984 wrote: I am very very new with C+. Anyone's help would be much appreciated. Been banging my head for 2 months.
erm... if you're so new to C# ( there is no such thing as C+ ), why are you taking on this task ?
Odds are that most people don't even know the product you're using. Don't they have a support forum ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
YDreams does have a support forum for this control but it is on this site and no one seems to look at it. I found YDreams Imagemap 2.0 on the Code Project website( Here )and was hoping someone has used this control and if they could help me out with the issue I'm having.
|
|
|
|
|
It's unlikely. But, if the article is orphaned, then perhaps it's your best bet. I would be looking for something else to use, or googling to see if it's also posted elsewhere and supported there.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hello
i have to create a web services in .net 2.0 php consume the services web.
can someone help me with guide, what type data are comun used to transport the data.
thanks,
|
|
|
|
|
I would assume so long as you don't send .NET classes, if you just send plain data like text and numbers, you should be fine.
Even if you sent a class, it's just a matter of working out how to parse it from the XML.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
thanks Christian
1. when i need to send data (a list of data repetitive)
house type B/.
villa nueva casa 5000.00
bethania apartamento 20000.00
wha type of data you recommend to transport from asp net2.0 webservice to php
2. when i need to send data (a list of data)
name lastname year
miguel sam 1980
wha type of data you recomend to transport from asp net2.0 webservice to php
thanks for the time
regards
|
|
|
|
|
|
Here is some tips for adding dynamic control.
. You have to create all the control before Page_Load() , Preferably on Page_PreInit() . Because if we create any dynamic control after Page_load() , The control will not maintain, ViewState and Postback data . Because, View State and Post back Load just before Page_load. So, if we create any control after postback, it will not able to get the view state and postback data.
Let me know if you have any problem.
Hope this information will help you
|
|
|
|
|
I know that
But I do not care about viewstate or Postback, all controls that should talk to server are in main page, not in update panel, only thing that do not work as wanted is ScriptManagers OnNavigate event. It fires too late. I need that event to handle f5, back and forward.
If controls are added as fallows:
protected void mi1_click(object sender, EventArgs e)
{
test();
}
all is ok
But in this case:
public void OnNavigateHistory(object sender, HistoryEventArgs e)
{
test();
}
it will not work
void test()
{
//This line works fine in both cases. It sets couple of properties, as label texts and session variables.
set_title("Test title");
//Instead of button I need my usercontrol, but even button will not show up.
Button btn = new Button();
btn.Text = "I bitīt matos!!!!!!!!!!!";
PHolder.Controls.Clear();
PHolder.Controls.Add(btn);
sm.AddHistoryPoint("aa", "bb");
}
It`s nothing to wory before something happen and when it happents it`s alredy to late to wory!
modified on Friday, July 31, 2009 3:15 PM
|
|
|
|
|
I am attempting to change the standard windows button style to an image. Below is the code with the Submit button and working .cs file. Below that is my failed attempt at using asp:ImageButton. Any suggestions/help would be appreciated.
Working Windows Button
.aspx file:
<br />
<input type="submit" Value="Submit" runat="server" ID="cmdSignUp"><br />
.aspx.cs file:
<br />
<br />
public partial class _Default : System.Web.UI.Page<br />
{<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
this.cmdSignUp.ServerClick += new System.EventHandler(this.cmdSignUp_ServerClick);<br />
}<br />
<br />
private void cmdSignUp_ServerClick(object sender, System.EventArgs e)<br />
{<br />
<br />
Failed attempt with using a custom image for button
.aspx file:
<br />
<asp:ImageButton ID="cmdSignUp" runat="server" ImageUrl="../../images/submit.gif" OnClick="Page_Load></asp:ImageButton><br />
<br />
.aspx.cs file:
<br />
public partial class _Default : System.Web.UI.Page<br />
{<br />
protected void Page_Load(object sender, ImageClickEventArgs e)<br />
{<br />
this.cmdSignUp.ServerClick += new System.EventHandler(this.cmdSignUp_ServerClick);<br />
}<br />
<br />
private void cmdSignUp_ServerClick(object sender, System.EventArgs e)<br />
{<br />
Thanks again for the time and help.
|
|
|
|
|
Try changing your ASPX file to this....
<asp:ImageButton ID="cmdSignUp" runat="server" ImageUrl="../../images/submit.gif" OnClick="cmdSignUp_ServerClick"></asp:ImageButton>
And then remove this line from your Page_load event....
this.cmdSignUp.ServerClick += new System.EventHandler(this.cmdSignUp_ServerClick);
|
|
|
|
|
|
i have got a requriment from the business where
i need to get an input from the user in the chinese
format and store the same into the database. The same should be shown when the user
clicked show button. The other information in the page cannot be a chinese but the input
i got from the user should be displayed in chinese.
My application is in ASP.NET and the database is in SQL server 2000.
i have no problem in displaying the data and storing the data into the database. The problem is how to get an input key in
by the user in the chinese format because the key boards by default will not
support that formats.
|
|
|
|
|
How to make dynamic Menu in asp.net using database.
|
|
|
|
|
What did you try so far to create dynamic menu?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
You can build menu dynamically from database using ASP.NET server side menu control.
Fill your hierarchical menu data from database into a DataSet and assign it to an XmlDataSourceusing DataSet.GetXml() method. Then assign that XmlDataSource to ASP.NET Menu control.
Check this article.
|
|
|
|
|
When I run SP from SQL Server it takes 1 second while using Parameter array and .ExecuteDataSet OR .Fill method it takes 10 mins to get same result.
Any body please help me out of this.
|
|
|
|
|
hi,
I implemented a Remote shutdown application using code like
<Process.Start("shutdown", " -s -f -m " \\machinename,username, _Securepassword, domainname);
>
The application is running fine from visual studio.but when i deploy the application in iis server it will not work.
Do I have to set any permissions to iis?
Thanks in advance
---------
nani
|
|
|
|
|
Do you get any Errors ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
By default, ASP.NET web site will run under ASPNET account in XP and Network Service in Windows 2003.
Therefore these accounts will not have permission rights to shutdown a remote computer. Run your web site under a account with appropriate permissions.
|
|
|
|
|
Hi...
Is it possible to make use of system32 dll or system dlls in .NET application.If so, how it can be achieved?
Thanks to all
Hashmat
|
|
|
|
|
|