Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
M

matsnas

@matsnas
About
Posts
36
Topics
18
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Custom control collapseble panel
    M matsnas

    I want to create a control that has a header (text and and image background) that when clicked, expands/collapses a body content. I want could easily create this with two divs(Div A and B) and a javascipt that sets the style attribute 'display' to 'none' for div B wen clicking div B but I want to hide this implementation. I'd like to be able to use the control somehing like this:   <MyControl ID="cc1" runat="server">     <HeadTemplate class="container_head">       SomeText     </HeadTemplate>     <ItemTemplate class="container_body">       <a href="#">List some items</a>       <a href="#">Add some item</a>     </ItemTemplate>   MyControl> ...or   <MyControl ID="cc1" runat="server" class="container_head" Text="SomeText">     <Div class="container_body">       <a href="#">List some items</a>       <a href="#">Add some item</a>     </Div>   MyControl>

    ASP.NET sysadmin

  • Escaping characters i nfriendly URL?
    M matsnas

    ...how this article relates to my problem? I have written an HttpHandler but when executing the following URl's I don't get the expected result: <a href=\"/artist/AC/DC\">AC/DC</a> //Handled "/" character as expected <a href=\"/artist/AC%2fDC\">AC%2fDC (/ )</a> //Expected to get the path "artist" and "AC/DC" <a href=\"/artist/AC%20DC\">AC%20DC ( )</a> //Works <a href=\"/artist/AC%26DC\">AC%26DC (& )</a> //Works <a href=\"/artist/AC%3aDC\">AC%3aDC (: )</a> //"Bad request", expected "artist" and "AC:DC" <a href=\"/artist/AC%2aDC\">AC%2aDC (* )</a> //"Bad request", expected "artist" and "AC&DC"

    ASP.NET question

  • Escaping characters i nfriendly URL?
    M matsnas

    Hi! Let's say I'm building a personal music toplist and want to be able to use freiendly urls to map from http://mysite/artist.aspx?id=12 to http://mysite/artist/madonna. This works fine using an HttpHandler and catchin the web request. However what about bands like AC/DC or Simon&Garfunkel? How can I escape the characters "/" and "&" etc.??

    ASP.NET question

  • Tagging emails to create a dialogue?
    M matsnas

    How should I go ahead to create a dialogue from a series of emails? My idéa was to receive an email, tag it with a uniqe id and then look for that id when receiving consecutive emails. If the id match, it's a reply to the same email. I want the reply to be indifferent to what the user has done to the mail i.e. the user should not be able to view or tamper with the id tag. Can I append the id to the SMTP header? Will this make it email-client-safe? How do I in that case read and write the header?

    ASP.NET question regex

  • Return multiple asynch calls synchronously?
    M matsnas

    Hi! I want to to fire a number of asynch method calls from a main thread and have the main thread return true synchronously if the method calls all return true, otherwise false. The asynch method calls should have a timeout which makes them return false. How to best implement in .NET 2.0? Performance is an issue! Pseudo code: public void main() {  SynchObj sObj = new SynchObj();  bool allTrue = sObj.SynchCall(); } public class SynchObj {  public bool SynchCall()  {   bool allTrue = false;   // Create X objects with 3sek timeout   // Fire Asynch calls   // Suspend main thread until all X objects   // ...have returned or timed out   // Resume thread and set allTrue = true if all   return allTrue;  } } public class AsynchObj {  public bool AsynchCall(int timeout)  {   // Make calculation   // Return true or false (if timeout, return false)  } }

    C# csharp performance help tutorial question

  • Performance: Partial Classes vs Inheritence?
    M matsnas

    Maby I'm still unclear in what I'm trying to do or I'm totally missunderstaning you. Example: I have a product class that i subclsss in BookProdukt and FilmProduct. They both have Title and Genre as attributes but the book has ISBN number and author while the film has IMDB id and director. Both film and book should have a summary attribute that gives the Title and ISBN or IMDB number. I would make a general product class that implements the title and genre attributes and two inhereting classes that implements the other respective attributes. Thus: Product - Title - Genre - Overrideble summary BookProduct - ISBN - Author - Overrides summary (returns ISBN + " " + Title) FilmProduct - IMDB - Director - Overrides summary (returns IMDB + " " + Title) As these objects are populated from a database I have a code generator that can create a file with the propertes for these attributes. As the generator cannot determine how the logic for the summary should be put together I need a way to seperate the logic (summary) from the data (Title, ISBN, etc) in case I need to regenerate the classes and don't want to loose the logic I've coded. This can be done in (at least) two ways: Alt1: partial class FilmProduct - IMDB - Director partial class FilmProduct - Summary Alt: class BaseFilmProduct - IMDB - Director class FilmProduct : BaseFilmProduct - Summary Now to the original question: Is there any performace gain in using either of the two alternatives?

    C# visual-studio oop performance question

  • Performance: Partial Classes vs Inheritence?
    M matsnas

    Thanks for the quick reply, but could you please explain how this becomes code bloat? I'm not talking about replacing inheritance generally by the use of partial classes (below called PC) only for the data carrier objects that our code generator creates. The idea of PC is to enable different user to work on the same object in different files, comp ASP.NET and code behind, and basically that's what we'll be doing. The code generator will generate the boring propertie classes and we'll write the class logic. As I see it I'll be writing the same amount of code (properties and logic) and files(PC or base&subclass) either way?

    C# visual-studio oop performance question

  • Performance: Partial Classes vs Inheritence?
    M matsnas

    Hi! I have a project where we will be generating base classes (basically just data carriers) and then implementing logic in concrete classes. Is there a runtime performance gain to using partial classes över using inheritance (or the other way around)? Alt1: public class concreteClass : baseClass { //...logic } public class baseClass { //...properties } Alt2: public partial class myClass // filename myClass.cs { //...logic } public partial class myClass // filename myClass.base.cs { //...properties }

    C# visual-studio oop performance question

  • Idea for ASP.NET/AJAX final year project
    M matsnas

    Today more and more young(?) pepole are moving away from e-mailing in favor of direct messeging services like ICQ and MSN Messenger. Perhaps you could investigare why and come up with some new idéas about what coule be the natural evolution step for email? Also I think emailing when sending to multiple receivers is a drag. The only way to keep the "broadcast conversation" going is to reply-to-all which creates A LOT of emails and finding the relevant info in an earlier reply is almost hopeless. I'm looking for a sort of merge between email, messeging and forum. You could use AJAX features to make the user interaction a happy experience (drag-drop receivers, constant pulling of new replies etc). Finally it would be very interesting to read about your conclusion on the different messeging services out there and what you see in the future in a thread here on codeproject.

    ASP.NET csharp asp-net help

  • page load precedence?
    M matsnas

    Thanx for the reply, I think you pointed me in the right direction. I found this article from Vivek Thakur. http://www.codeproject.com/useritems/lifecycle.asp[^] From where the page life-cycle-summary is: 1. OnPreInit 2. OnInit 3. (LoadViewState) ONLY ON POSTBACK 4. (LoadPostBackData) ONLY ON POSTBACK 5. Page_Load 6. (recusive Page_Load's for masterpages, other pages, controls) 7. Control Event Handlers (like Button1_Click()) 8. PreRender 9. (recusive PreRender's for mas...) 10. SaveViewState 11. Render 12. (recusive Render's for mas...) 13. Unload ...and from what I can gather, if dependent of the state of user controls placed in a masterpage, I should put the code in prerender as you said. How come all beginner tutorials are so focused on Page_Load then?

    ASP.NET help question

  • page load precedence?
    M matsnas

    I have a LoginControl.ascx control and a ListItems.aspx page. Thay are placed in a MasterPage.master. I want the login control to be able to handle manual login as well automatic login from reading a cookie. Depening on the login result the list will display different set's of items. My problem is that when starting the ListItems.aspx the order of page load is: 1. ListItems_PageLoad (displaying a list of item based on NOT logged in state) 2. Master_PageLoad 3. LoginControl_PageLoad (automatically logging in the user) This means that the list is displayed on the NOT logged in state and I have to refresh the page to get the correct list. If I click logout in the logincontrol the list is rendered in the same way: 1. ListItems_PageLoad (displaying a list of item based on LOGGED IN state) 2. Master_PageLoad 3. LoginControl_PageLoad (logout the user) How should I go about programming to get the result I want? 1. ListItems_PageLoad (Initalize the login procedure) 2. Master_PageLoad 3. LoginControl_PageLoad (loggin out the user) 4. ListItems_PageLoad (complete the load, displaying a list of item based on LOGGED IN state) What am I missing?

    ASP.NET help question

  • Posting in asp.net
    M matsnas

    Hi! I have a login control (LogIn.asmx) and a search control (Search.asmx). When typing in the search control and pressing return the whole page is posted to the server. My login control is looking for IsPost back but still it tries to log me in?! How should I do to prevent this behaviour? How can I make the page respond to the "correct" submitevent? Thnx!

    ASP.NET question csharp asp-net sysadmin

  • null value in typed dataset?
    M matsnas

    Hi! I have a DB table that references it self to create a hierarky. If the ParentRoleId column is null then the Role represents a top level role: Database columns:   RoleId PK (Identity)   ParentRoleId FK (Allow null)   RoleValue Now to the question: I'm using typed datasets as database access, but the generated code for the ParentRoleId column is of the type int and thus doesn't support null. How should I create a workaround for this?

    ASP.NET database question

  • next 10 records?
    M matsnas

    I should say that I'm not using databinding. I'm surprised that I havn't got more replies to this as I thought that this would be a simple question. I will look at the page data source control but I see this as a more general question, to retain a value between postbacks. I tought the whole idea with code behind was to allow the programmer to utilize more of the same programing thechniques as when writing a WinForms application. I'm surprised that ASP.net cannot handle member variables. Why arenä't these stored and re-initalized by the view state as a controls properties?

    ASP.NET question csharp asp-net database sysadmin

  • next 10 records?
    M matsnas

    I think you missunderstood me. My SQL supports 2 parameters, number of records to return and offset from where to return records. EX: Nof=10, Offset=10 will return records 10-19. I will olny return the number of records that I need from the data-tier. My question is when hitting the linkbutton "next 10 records" and the postback fires, how do I remember the offset variable. For each time I press the "next 10 records" I want to offset counter to increment by 10. In old ASP I would have submitted the Offset parameter as an appended querystring parameter: Ex: <a href="List10Records.asp?intOffset=10">next 10 records</a>. How should I do in ASP.net 2.0?

    ASP.NET question csharp asp-net database sysadmin

  • next 10 records?
    M matsnas

    Just learning asp.net and have a basic question. I have a list of records that I want to display 10 at a time. I have the SQL for it but how should I do in ASP.net to send the offset where I'm currently at? Code:    Private mNofRows As Integer = 10    Private mOffset As Integer = 0    Private Sub AddNavigationHandlers()     Dim vLinkButtonPrev As LinkButton = DirectCast(Me.Form.FindControl("EntryNavigationPrev"), LinkButton)     Dim vLinkButtonNext As LinkButton = DirectCast(Me.Form.FindControl("EntryNavigationNext"), LinkButton)     AddHandler vLinkButtonPrev.Click, AddressOf EntryNavigationPrev_Click     AddHandler vLinkButtonNext.Click, AddressOf EntryNavigationNext_Click     vLinkButtonPrev.Enabled = mOffset > 1   End Sub    Public Sub EntryNavigationPrev_Click(ByVal pSender As Object, ByVal pEventArgs As System.EventArgs)     mOffset -= mNofRows     GetRecords(mOffset, mNofRows)   End Sub    Public Sub EntryNavigationNext_Click(ByVal pSender As Object, ByVal pEventArgs As System.EventArgs)     mOffset += mNofRows     GetRecords(mOffset, mNofRows)   End Sub I was hoping that I could have the member variables set at first time and then use them as shared to retain the value between postbacks, but this doesn't seem to work. Should I be using the tag property of the LinkButtons? Should I be saving the value in a session variable? Should I be saving the value in a hidden control? Should I be saving the value server side using a session object to hold the business tier object with state?

    ASP.NET question csharp asp-net database sysadmin

  • Sick of ClearQuest
    M matsnas

    Didn't find the perfect category for this kind of question but here goes: Today we use Rationals products ClearCase and ClearQuest for version and change handling. However they are costly and not very user friendly. I like the concept with the integration between vs2005->CC->CQ but the products are not working to my standards. If I were to replace CC for VSS, what would be the replacement product for CQ? I want to have the integration where I can create a release on which the users can submit change request emerging to a workorder and baseline code from vs2005 to that workorder. As the corporate desicion is to use CC and CQ I will need a web interface towards the change handling tool in order for users around the world to be able to submit CR's without installing any software.

    Visual Studio question announcement

  • Unloading AppDomain [modified]
    M matsnas

    Ok, I'm not sure I understand what happens or what to do about it but as the first article talks about leaking datum into the original AppDomain it seems like loading the Plugin loads an extra assemby into AppDomain.CurrentDomain. I thougt that I was only calling a sub on the interface object IPlugin. Why is the AppDomainClient.DLL loaded and how do I prevent this? More correctly, how do I assure that my plugin can be removed from memory at any time?

    Visual Basic security performance help question

  • Unloading AppDomain [modified]
    M matsnas

    Thanks, I'll have a go at the examples you posted. Just one question though, I was expecting to be able to have other programmers write plugins for my application but using AppDomains I would be able to securly shut these plugins down and unload them without disturbing the plugin host? Note! Written from memory so there might be compilation errors... namespace AppDomainHost   public class Host     private mAppDomain as AppDomain     private mIPlugin as AppDomainInterfaces.IPlugin     public sub New()       Dim vEvidence As Evidence = AppDomain.CurrentDomain.Evidence       mAppDomain = AppDomain.CreateDomain("MyAppDomain", vEvidence)       mIPlugin = AppDomainInterfaces.Factory.CreateIPlugin(mAppDomain, "AppDomainClient", "AppDomainClient.Client")       mIPlugin.Connect       AppDomain.Unload(mAppDomain)     end sub   end class end namespace namespace AppDomainClient   <serializable()> _   public class Client     implements AppDomainInterfaces.IPlugin     private mForm as Form     public sub New()       mForm = new Form()     end sub     public sub Connect() implements AppDomainInterfaces.IPlugin.Connect       msgbox("Connected")     end sub   end class end namespace namespace AppDomainInterfaces   public interface IPlugin     sub Connect()   end interface   public class Factory     function CreateIPlugin(byval pAppDomain as AppDomain, byval pAssembly as string, byval pType as string)       dim vIPlugin = directcast(pAppDomain.CreateInstanceAndUnwrap(pAssembly, pType), IPlugin)       return vIPlugin     end function   end class end namespace

    Visual Basic security performance help question

  • Unloading AppDomain [modified]
    M matsnas

    Well actually I did but only because I didn't get the Performance Monitor working in a good way. Anyway I also tried to have my plugin display a WinForm in it constructor believing that it would go away when my plugin's appdomain was unloaded but it didn't. I'm missing some vital part of understanding here I think. All documentation refer to the current AppDomain beeing "unloaded" but what do they actually mean by unloaded? Valid for unloading when the GC feels like it? I would have guessed that the AppDomain stopped/killed and all allocated memory space freed.

    Visual Basic security performance help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups