I have a page with two tabs.
These tabs do not contain text but images.
now the thing is that when a tab is active, it contains different image and when it is inactive it contains different image.
So there are a total of 4 images ( 1 Active state & 1 Inactive state for each tab).
Could anyone guide me with the desired code using Asp.net with HTML controls(not server controls), Javascript and css.
Thanks in advance
If you are not going to use jQuery (or similar) for this, then you can probably write your own JavaScript code. When the onclick or onfocus event is raised for switching between tabs (however you manage it), just call a function to change the src of the image on the active/inactive tabs.
You can either use JavaScript to hide the images or use a CSS sprite so when the tabs are active the css changes and shows the different images
Related
I've used the answer to this question to develop tabs that have a add tab and remove tab functionality: Close button for TabPages of Right To Left TabControl c#
The look here is very different compared to the default tabs look. How do I paint the custom control in the above question to make it look like the default tabs look? Images below to demonstrate what I mean.
This first image here shows the default look without having the tabcontrol being overriden by ownerdrawmode.
This second image here shows the look from the answer in the link.
How about using custom drawn controls instead of those tab headers (i guess thats how they are called) and loading user control instead of that tab page? it can be easily done: here is "tabs" (user controls) sample https://github.com/WithoutCaps/LimitlessUI/blob/master/LimitlessUI/TabsAdapter_WOC.cs
(there is project demo too )
I am new to C# and I am using windows forms.
I don't know if the term "browse" is right to use in this case or not.
I have Form1 with 3 buttons ( buttonA , buttonB and buttonc) in it.
I linked buttonA with a user control which contains 20 buttons and each one of those 20 buttons is linked to a user control which contains 10 buttons each of which does an action which it is clicked, also same thing applies to buttonB and buttonC . Now I configured user controls visibility when button clicked . For example:
Click buttonA user control1 with 20 buttons show up, click one of those 20 buttons another user control show up with 10 buttons.
What I am trying to do is something like browsing windows folders but in this way I will end up having too many user controls and it is confusing and I feel this is not the correct way of doing it. Can anyone please help me if there is another way to do taht? Thank you
What I am trying to do is: I click on
Your scenario seems to be ideal to use TreeView control. This controls displays a hierarchy of items, in your case a hierarchy of products and subprodcuts. A user of your application will be able to expand/collapse nodes as he/she want just by clicking a node. It is much more intuitive and readable than pressing buttons.
For example you can easily achieve the following icons:
You can also associate icons with nodes, change their background or foreground etc.
I think ListView control may fit your needs. It can display a lot of items in different forms (for your task consider using View.LargeIcon or View.Tile for ListView.View property). It also supports groups that may be useful for building POS system.
I have used calendar control of ASP.NET. When I move on any date than it will be display tooltip , in which I can show my another aspx page. And in that aspx page there is gridview.
How can I display tooltip which contains aspx page.
Try this
Track one
Use a div to position your element as a tooltip.
In that div use an iframe in which you can load your aspx page.
Track two
you can use div without iframe and use jquery to pull data from server against hovered date and render that data into that div at runtime using $("#divID").html() function.
Personally I would recommend track two because here page life cycle is eliminated and data would load much faster which is required for a tooltip,
only demerit with track two is that its a little complicated because you will have to create your design at runtime using document.createElement() and other functions like that.
You could get some help from Here maybe.
I am working on .net 4.0 application. I am trying to load a bunch of custom controls that has a "gridview" control along with several text boxes and dropdowns. As the viewstate is really slowing down the system in order to improve the performance I Disabled the ViewStateMode of the parent control (i.e User control) and Enabled the ViewStateMode for dropdowns. But the problem I have is the dropdowns inside the gridview and panel thrw an error even though their ViewStateMode is Enabled. If I Enable the ViewStateMode of gridView or Panel it works fine but that's increasing the size of Viewstate.
Can somebody please make me understand why it is happening and what is the solution for this?
Thanks
BB
If you are getting tons of viewstate.Then I would suggest you two ways that worked for me too
Compress Viewstate - http://www.codeproject.com/KB/viewstate/ViewStateCompression.aspx, http://www.hanselman.com/blog/ZippingCompressingViewStateInASPNET.aspx
Trace the layout of the rendering area in html, using div , ul, li wahtever. Now instead of placing grids and other server controls, get the datasource(datatable or dataset), itereate through the items and make the html in the codebehind and write the final html tag on page using a literal. using html controls you can get rid of the view state issues. Also on that html tag you can apply jquery to make it better too.
I am having a grid in gridpage.aspx and on clicking the search button in gridpage.aspx. it opens a search popupwindow with search criteria and after entering the search criteria and clicking the search button in the popup window will close the popup window and displays all the records in the gridpage.aspx.
the scenario is when i am retreiving lakhs of records i want to display the user with some update that the search is still in progress
Not clear on how you are doing the whole popup logic (ie: client side code, update panel, etc). I'll go the simple route and assume you are using an UpdatePanel.
You could have a panel (div) on your page with a default visibility of false (css style = display: none) that contained an animated "loading" icon.
When the users clicks search you could change the visibility (css style = display: block) to true.
You could also accomplish this using javascript client side if clicking "Search" isn't already causing a postback.
You can make use of you can have div with an gif image and display that while the search is on. You can make it visible in the beginning of the method where search starts and hide it in the end.
If you are using UpdatePanel, go for UpdatePanelAnimator (or something like. Don't remember the exact name). It will also gove the same effect.