Jump to content
Xtreme .Net Talk

hrabia

Avatar/Signature
  • Posts

    107
  • Joined

  • Last visited

Everything posted by hrabia

  1. http://weblogs.asp.net/pwilson/archive/2004/12/23/331455.aspx Adam
  2. .NET 2.0 offers HtmlLink class, so it's easy to do it. In 1.1 you have to do it a little bit tricky: html: <HEAD id="pageHead" runat="server"> <title>WebForm1</title> <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"> <meta name="CODE_LANGUAGE" Content="C#"> <meta name=vs_defaultClientScript content="JavaScript"> <meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5"> <LINK rel="stylesheet" type="text/css" href="StyleSheet1.css"> </HEAD> in code: protected System.Web.UI.HtmlControls.HtmlGenericControl pageHead; Up now you can access InnerHtml property and change it's content. For example to change href: pageHead.InnerHtml = pageHead.InnerHtml.Replace("StyleSheet1.css","StyleSheet2.css"); It's not very cool, but I haven't found a way how to add runat="server" attribute directly to <link> tag (I receive parse errors) (BTW. in 2.0 works). Greets Adam
  3. The right way to do this is to make your title tag "visible" to your code using HtmlGenericControl: html: <title runat="server" id=pageTitle>My Page</title> code: protected System.Web.UI.HtmlControls.HtmlGenericControl pageTitle; protected override void OnLoad(EventArgs e) { base.OnLoad (e); pageTitle.InnerHtml = "My Title from Code"; } Greets Adam
  4. Hmm, when we are taking about using webservices as RPC, ok, but we have now "The Year of SOA, EAI etc." Using General or ASP.NET to talk about SOAP, WSDL etc. is in my opinion no so ideally. We have also such programs like BizTalk 2004, that is fully integrated into VS.Net and starts to play very important role in integrating apps. So, maybe new forum :) ?
  5. We have a forum for regular expr. but no for web services... or am I blind ;)
  6. AFAIK there is no such error code. You have to do it on your own way. To make it fully automaticaly I've build a small client java script, which redirect user to my "session time out" page whithout need of user's postback (it's pretty uncool when someone receives info, that the session timed out, during submitting of a form).
  7. in Html: <body runat="server" id="TagBody"> in Code: protected HtmlGenericControl TagBody; private void Page_Load(object sender, System.EventArgs e) { string _Script = @"<script>"; _Script += @"function showMessage()"; _Script += @"{"; _Script += @" alert('Hallo World!');"; _Script += @"}"; _Script += @"</script>"; if(!this.IsStartupScriptRegistered("Message")) { this.RegisterStartupScript("Message", _Script); } TagBody.Attributes.Add("onload","showMessage()"); } When you have a big java function (a lot of text) use instead StringBuilder object. :) Greets Adam
  8. It seems to be true :) http://support.microsoft.com/default.aspx?scid=kb;EN-US;889877
  9. Show your html code. Codebehind is ok. Are you sure that your controls have this ids: td_Services and adminTabs1? In html something like that: <uc1:WebUserControl1 [b]id="WebUserControl11"[/b]runat="server"></uc1:WebUserControl1>
  10. What's the id of your user control in page (in html)? Your control has probably other id than "WebUserControl11".
  11. If you want to use HttpApplication-derived class (global.asax) to store state of objects it is bad idea because of application pooling.
  12. > how to bound the list with database items using javascript. JavaScripts runs in client's browser, databinding on server. You can't mix it.
  13. Make your /td/ public available (in user control): public System.Web.UI.HtmlControls.HtmlTableCell td_Name; than in page make your user control available for manipulation (in webform): protected WebUserControl1 WebUserControl11; and than... WebUserControl11.td_Name.BgColor = "#FF0000"; Greets Adam
  14. I've a combobox to change language on my page. Because of page lifetime, I have to set all my labels, texts etc. from ResourceManager in prerender handler to be sure that culture change has been done. I can't set HeaderText property of DataGridColumn in prerender because it is evaluated during data binding. I don't want to call DataBind() in OnPreRender also... Any ideas? BTW. I can walk through Controls collection, but it's very poor, hard coded solution (and problematic when we have some sortable and not sortable columns).
  15. No, it's not for licensing purposes :). I'm bulding some kind of standalone host for net. remoting. But thanx for the offer and description.
  16. What about terminal client and two or more admin users on the same server?
  17. Thanx, I've read a little bit about mutex class: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemThreadingMutexClassTopic.asp Your sample is ok, but I've to lose problem, when two or more users (or one user in two or more sessions) want to start my aplication. I'll have to block ability to create more then one instance of my application in one session, so "Test" is too global. Thanx anyway Adam
  18. How to check that only one instance (pro user) of my application is running?
  19. Hmm, ApplicationContext takes my main form as constructor parameter: static void Main() { MyContext _MyCtx = new MyContext(new MyForm()); Application.Run(_MyCtx); } where MyContext derives from System.Windows.Forms.ApplicationContext, so I've looked for some kind of standard way (parameter) to get the context within a form (something like that: myForm.Context, like in ASP.Net that has it's HttpContext).
  20. I have my own app context, and I'd like to check some properties from within a main form. How can I achieve this?
  21. I have to write a simple workflow engine in .net. I don't want to use such big frameworks like Skelta Workflow.NET. Where can I find some whitedocs about creating the workflow engine. The only thing I've fount was http://www.openwfe.org, but It's to complex (I realy neet only 5 basic control flow patterns). Thanx for any hints :) Adam
  22. That's not so easy ;). Full idea by Scott Mitchell http://aspnet.4guysfromrolla.com/articles/072104-1.aspx Adam
  23. Don't mix two things: static type members ("language level") and type of state (ASP.Net). Your problem is to share objects between pages and between sessions. To share objects between pages use session state (that's the simplest way) and to share objects across all clients use application state.
  24. BTW: the VB compiler translates a module into class in which all members are marked as Shared (static in c#). The genereted class is NotInheritable (sealed). A static field denotes exactly ONE storage location. No matter how many instances of a class are created, there is only ever ONE copy of static field...
×
×
  • Create New...