Does anyone know how to create a custom webcontrol like the panel control ? I can't figure out how it enables you to click on it in design mode and type in text. If I put any HTML inside my custom control tags the designer barfs an error X| . Cheers Steve
Steve Murrell
Posts
-
Panel type custom webcontrol -
Missing - WebControl.MapPath()Paul, I am inheriting from System.Web.UI.WebControls.WebControl. Server.MapPath is fine at runtime, but when I use it from my custom designer which inherits from ControlDesigner it blows up in GetDesignTimeHtml() as no Context is available. When I drag the control from the toolbox and drop it, I get Grey box saying Error Creating Control. As soon as I remove the call to Server.MapPath I can use my control again at design time. I guess whatever is hosting the control at design time is not supplying the required interfaces. It's a bit of a pain as my control is an XML driven menu and really needs to load the XML file at design time in order to look the part of a nice WYSIWYG control. Cheers Steve
-
Missing - WebControl.MapPath()No Luck - Server.MapPath also is not valid at design time. Cheers Steve
-
Missing - WebControl.MapPath()Hi, I am writing a Web Control and have a problem at design time. There is no WebControl.MapPath() function. I am loading an XML file which cannot be done using relative path names. At design time you cannot access Page.MapPath() as no page exists. I have a horrid solution where you specify the full path and filename at design time and then mangle it at runtime, but I hoping someone could come up with something better than this -
String MapXMLFileName(String xmlFileName) { //When you specify the XML Filename at design time you select //the absolute path and filename on the development server //(otherwise it can't be loaded at design time). //At run time however this now needs to be converted into a mappped path. //We need to allow for subdirectory differences e.g - // //xmlFileName = "c:\inetpub\wwwroot\dotNet\TestApp\XML\Menu1.xml" //but should be = "d:\intepub\wwwroot\companyname\TestApp\XML\Menu1.xml" // //Map a dummy name first - "./Test.xml" becomes //xmlDummy = "d:\intepub\wwwroot\companyname\TestApp\Test.xml" // //Next strip off the dummy filename so we get //xmlMappedRoot = "d:\intepub\wwwroot\companyname\TestApp" // //Now extract the directory we are working from //xmlDirectorySegment = "TestApp" // //Now look in the original xmlFileName to find that Directory and take //everything after that //xmlPathSegment = "\XML\Menu1.xml" // //Finally add the xmlMappedRoot and the xmlPathSegment to get the //new mapped path //xmlMapped = "d:\intepub\wwwroot\companyname\TestApp\XML\Menu1.xml" String xmlDummy = Page.MapPath("./Test.xml"); String xmlMappedRoot = xmlDummy.Substring(0,xmlDummy.Length - 9); String xmlDirectorySegment = xmlMappedRoot.Substring(xmlMappedRoot.LastIndexOf("\\")+1); String xmlPathSegment = xmlFileName.Substring(xmlFileName.LastIndexOf(xmlDirectorySegment)+xmlDirectorySegment.Length); String xmlMapped = xmlMappedRoot + xmlPathSegment; return xmlMapped; }
Cheers Steve -
Can this be done ?Hmmm... Took a little while to make the stuff work. My system has 2 network connections. One for the cable set top box for broadband and one for my local network. Add in ZoneAlarm as the firewall and mix until thoroughly confused. IIS on this machine is bound to the local network, BUT it is not resolved to LOCALHOST (i may need to switch network connections over). So I had to edit the .config files to use the actual IP address. The web client implementation wants me to log in as I am not authorized to view the page even though IIS is configured for anonymous acess and so refuses my administrator password :confused::mad: However, running the service using DirectHost service works when using the consoleclient. I have loads of questions but I will carry on playing for while... Cheers Steve
-
Can this be done ?Many thanks for that, if remoting only needs a few lines of code, then as you say it is not overkill ! I guess the answer then is to connect from the Webservice to the App via TCP/IP. If you have any samples of 'simple' remoting on the same system then that would be great. Cheers Steve M
-
Can this be done ?First of all, I am new to C# and .NET programming, however initial impression is very favourable, despite my brain complaining that it is already full up. Anyway, I am trying to get a client system running a web browser, to exchange text with an application, running on a remote server. I have looked at .NET Remoting and it looks like overkill for what I want to do :omg: So does the panel think the following will work ? Client - Web browser running the DHTML Webservice Behaviour Server - C# WebService talking to - C# Windows Forms Application Seems a simple solution to me :~ however I can't work out the best way to get a C# WebService to talk to a C# application. Appreciation for any help given will be shown with virtual beers (I am sure someone around here uses a beer icon, but I can't see it in the list of smilies) Cheers Steve
-
SOAP StarsI have just downloaded V3 of the SOAP toolkit from MS. The docs imply it should be possible to link a SOAP request on to most COM components using the WSDL Generator to create the needed files. So... Does the panel think it would be possible to use an MFC app (with a dual interface to get the required IDISPATCH) as the target for SOAP. If so this could make for a very nice remote control technique which avoids the horrors of DCOM - been there, done that, gave it up as a bad job :wtf:. Wild guesses and educated musings welcome. Cheers Steve
-
I got my cable modem!I am in on old C&W area. Either way I have a 2nd cable box next to my PC anyway so I should be sorted. Can't wait for let rip with 600K :cool::) Cheers
-
I got my cable modem!Thanks Anna Steve M
-
I got my cable modem!Hi, Anna My NTL Cable modem is being installed this Saturday (so they claim). I am having an upgrade from analog cable to digital cable and decided to go for the broadband while I was at it (actually the updgrade was just an excuse to get a cable modem ;)). >All I needed to be told was the IP of their registration server, >and to find that out I spent an hour in a phone queue >which of course, being a tech support call isn't free). Can you save me few quid an let me in on the secret IP of the registration server in case I suffer the same problem you did :rose: BTW does it connect to the NTL phone line or the actual cable TV feed ? On the early version I saw the digital cable box had a network connector on it, however I have a feeling that the newer version is a USB device. Cheers Steve M