Can you make a "separator" in ASP.net Textboxes? (C#) - c#

I was just curious if it's possible to put a "separator" (Not sure what you'd call it) in a textbox in ASP.net. For example, I want a textbox on my form to be a blank textbox with "blank:blank:blank" so they can just type the time, and another to be "blank/blank/blank" for the date, and so on. I've tried googling it for a bit but didn't find what I was looking for, probably because I'm calling it a seperator, and I'm not sure how accurate that is. I was hoping it could be done that way, but if there's another way, I'm using C#. Let me know if I explained that right at all or if you can recommend anything. As before, I appreciate the help from this community!

Probably should start with checking out if an input mask meets your needs. The AJAX Control Toolkit might be a good place to start when looking at easy to use controls. Check out their MaskedEdit control at: http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/

Use the MaskedEdit control in ASP.NET (from the AJAX Control Toolkit), should do exactly what you want.
HOW TO Use the MaskedEdit Control in ASP.NET

Related

Compare strings in WPF and highlight differences in Side by side window

I am working in a wpf project in which I need to compare two strings and display in a side by side window with line number should be shown and differences must be highlighted with color.
I am new to wpf and I don't have any idea about completing this task.
Please help me.
Are you looking at something like Syntax Highlighting of Text after comparison(or identifying the differences)? Below links might help you if you want to do simple highlighting of the text. The idea should be simple perhaps:
Identify the Difference
Find the start and end position of difference
Highlight the difference only.
If you'd want to go for simple solution, check these link if they work for u:
https://code.msdn.microsoft.com/windowsdesktop/CSWPFSearchAndHighlightText-3b5e207a
https://social.msdn.microsoft.com/Forums/vstudio/en-US/7c9a622a-4e3b-451e-bc4c-ab9d011447e0/texthighlighting-in-wpf-richtextbox?forum=wpf
Moreover, there are several controls available online for Syntax Highlighting in wpf. You can simply search for it. I came across Fast Colored TextBox on CodeProject once for similar requirement. Hope this helps.
I think this would be the generic advise I might be able to offer for a generic question like this. Or u may want to go a bit more specific about what type of content you are trying to highlight? Is it Rich text or plain text in a TextBlock? And as the comment above? Any research & considerations you've done? And any code to give an idea about the scenario?

How to create a Dropdown button in asp.net c#?

Does anyone know the name of the property in which it look alike button
but once if we keep the mouse pointer
on it then it will show like dropdown
list options.
I want to use that in my asp.net
project.
There is no out of the box control as such. It is an effect achieved either using javascript or CSS
Take a look at this example
http://demos.9lessons.info/DropMenu/MyDemo.html
You should also search for jquery plugins for this. Though you will get readymade code for it but it will surely not be a server side control. You have choice of either creating a user control or just use it as it is.
unfortunately there is no such control out of the box in asp.net. you might want to look at third party controls or do some css magic.
Something like that maybe a standart one(1) .But I can recommend you to use telerik if you are using it already here is a example (2)
Example2
Example2

Is there a way to post (common post with form) without changing screen position?

I have a general question and I have no code to show (because I wouldn't know what to try).
I have tried to research this, but I guess I'm either not searching for the right keywords (or looking up the right words in my book's index), or such thing doesn't come easily.
All I want to know is if there is a way to post, using the common form method, in WebMatrix (C#) that will not change the position of the screen after post, regardless of what that position may be?
It may not exist, but it seems like it might, and I would hate to think it didn't exist, if indeed it did, just because I couldn't find any topics on it.
Usually you'd use Javascript/Ajax to submit your post asynchronously. But since you asked for the "common post method", which I assume you mean a normal button-click post event, you should check this answer:
ASP.NET MVC3 Razor - Maintain scroll position on postback

Is it possible to generate code properly through a toolbox custom control?

Ok, so long story short, I was working on a .NET WEBFORMS project which was capable of creating ASPX pages through an ASPX form, which was basically a drag and drop controls page which, we could say, seemed to be a basic but functionality acceptable page/wizard/aspx-creator.
Well, now my higher-ups decided that approach is not a worthy solution and, I don't know why, they got into their heads that this, instead of this ASPX creator form, could be implemented through custom controls added to the toolbox.
So, my doubt is... is that even possible? Or better, is that a reasonable solution? I mean, the first cons I've already found is the fact It seems that it's impossible to yield CodeBehind code by the drag and drop method.
Thanks in advance!
Custom Controls
This MDSN walkthrough teaches you aboutmaking custom web controlls for asp. these would be able to appear in your tool box and could be dragged into its respective place, is this waht you are looking for?
EDIT:
Re-reading it looks like you want to be able to drag in bits of code and have certain regions prompted for edits, this CAN be done, using snippets. if you type propg or propfull and tab twice it constructs that code and tells you what bits to edit right? you can make your own snippets!
Creating custom snippets
failful msdn tutorials to the rescue once more!

Drag and drop widget code

I have been asked by my boss at work to look into allowing widgets on our home page that can be dragged and dropped and the setup saved for each logged in user (or maybe done by cookies so user doesn't need to be logged in).
Are there any out of the box (preferably free) libraries that can be used? If it requires server side functionality then that's got to be c#/.NET.
I can probably put something together myself but it seemed very much like it is reinventing the wheel. :)
And this is my first question just asking for a recommendation so I'm not sure if this is the right place or if I should put in more details.
An example of the kind of thing I want is http://www.google.com/ig.
And sorry if this isn't a well formed question. I wasn't sure where else or how else to ask it. :)
jQuery & jQuery-UI will do this out of the box if you use the sortable function. The "portlets" demo seems to fit your description. You'll still need to save state manually, but that shouldn't be too difficult with an event listener.
This is a good tutorial of how to build something similar to Google's IG by using ASP.NET AJAX. The source code is a bit outdated, but you can get an idea of what should be done on the client and on the server and re-use the code:
http://www.codeproject.com/KB/ajax/MakingGoogleIG.aspx
Also take a look here:
http://www.codeproject.com/KB/aspnet/drag_drop.aspx

Categories