Implementing Forms/Button - button

New to access and I am trying to build a database to organize some in-house parts. I currently have a table containing measurements, photos, etc and having it displayed through a form. The form would show these values and the image of said part. Id like to add two buttons to the form that will
pull up a pdf of the drawing file and
List item processing specs.
So far I have tried creating hyperlinks or embedding the files into the form, but if you were to search for another part, it would direct me to the same two files no matter what part is displayed
I wanted to know if was possible to make it so if you change the search for the data displayed and how to go about implementing it if it is.

I don't know the full circumstances of course, but typically you would add a TextBox control to the form that is bound to the hyperlink field in the table.
If you wish to use a Button instead then I would probably use the Current event of the form (triggered as the user moves between records) to change the hyperlink properties of the button to those of the (bound) hyperlink field. These properties are:
Hyperlink Address, Hyperlink SubAddress and Hyperlink Target
(and the button's Caption)
It might require code on other events as well, to cover different eventualities.

Related

Asp.net controls losses the value

I am using two tabs in my page like the attached image.
.
Here, after selecting the value in all dropdownlist controls then, i click the generate button. so, the tab is moved from parameter to report. Then again i click the parameter tab. At this time all my dropdown controls shows null value.
but I want all the dropdown values which i selected before.
how can i get the dropdown control values?
It's important to remember that web pages like this are stateless. One request won't remember anything about another request.
So in your situation, you're putting in data, then it sounds like you're clicking a link (or button) that redirects you to another page, then you try and go back to the first one, and it has to fire off yet another request, with no knowledge of the first one's state.
Given that, it seems like you have two primary options (and dozens of others that I won't bother mentioning):
Move the tabs to be on the same page. (My recommendation)
There are lots of controls out there, or you could easily write one yourself, that don't separate tab pages via multiple requests. If you did that, switching tabs wouldn't lose the data.
Add a "save" button, and disable the other tab.
This way, the user actively has to save the data before being able to leave the page via another tab. The biggest issue here comes in the form of usability.
Which one of those you choose is dependent on a number of factors, not the least of which being code maintainability and the size of requests.

Room drawing controls

i need to add some functionality to an asp.net application that allows the positioning of tables, and other objects like doors and pillars in a room. The tables can be of a few pre defined shapes, and need some text information inside them, like table name or something. The user should be able to drag these shapes into position. The position etc of these shapes then needs to be persisted in a DB. the actual size and shape of the room also needs to be 'drawn' by the user, and again stored in a DB.
Before i embark on some WPF/silverlight project or something, does anyone know of any controls, either asp.net, or silverlight, or even jquery etc that will allow me to do this ?
Edit - The app is asp.net web forms with partial page rendering using ajax.
I would use a combination of HTML tools:
jQuery UI draggable lets you do the dragging around bit quite easily.
You can include input text boxes in the draggable elements to hold names of objects and style them appropriately.
By hooking on to drag events, and copying the coordinates into hidden input tags, you can create an HTML form that, when submitted, should contain everything you need to save the room to the DB.

ASP.Net, how to put hyperlinks in datagrids.

Hi i have a datagrid I've put in on a aspx web form in visual studio 2010, I'm new to this so I've been following the ms tutorials.
One of the columns on my data grid contains a lot of information, is there a way i can add a "+more" option in the cell next to the entry that shows only the first few characters of that cell, but once clicked opens all the information on that particular entry but onto a new aspx form?
Thanks for any help!!
There are basically three different ways...
Structure your data object/query so that it returns a key and and abbreviation (i.e, first name, last name, id, bio) and use a template that turns id into a link.
Use the onrowbound event to manipulate the controls on the row, so that you have a href to your details page.
Use css to show the additional info on a hover/mouse over (I like this, but it doesn't play well with mobile devices, which don't have either event).
EDIT: Methods 1&3 would be done on your aspx page, method 2 would be done in the codebehind for your page. Method 1 is really dependent upon your being able to control the data object/ query results. If you are calling a stored proc that someone else controls, it may be very difficult to make it work.

Input buttons as links?

Is their a case for using input buttons as page links, when your linking to the next of a series of pages of a form where your filling out information?
UPDATE - Ive inherited a site. One section is a series of pages of forms that users fill in. The 'next' link to the next page is currently an input button, not a normal link.
Is this bad from a standards / semantics point of view?
I am not sure what you exactly want. But what about, you can use the button to navigate through the pages. Just put the url address of the next page.
<form action="page_number_2.htm">
But you will need to store formulat data from every page. I mean, if the user fill the formular on one page and go to the next formular, you don't want to lose the data from the filled formular. You can stored them with php until the user will reach the final formular step, where he will klick submit-button.
Actually the link is used for navigation through the pages. But in this case, if I understand right, you need to send data from formular, if the user go to the next formular. So in this case, better to use button. Still you can make this button look like link.
It is possible to make links appear as buttons. However, in the situation you describe, it would be a bad idea. The form data will only be submitted to your server if you use a form. Allowing the user to click a link to go to the next page will cause you to lose all of the data they entered (Unless you are collecting that data via AJAX).
It is usually best to allow page element to perform the functions they were designed for to avoid confusing your users. Users expects links to work like links, and buttons to work like buttons.

best way to generate and highlight menu items on server (asp.net)

I have an ascx component, that holds two-level menu, because there are several user types, and the menu needs to be computed on server.
Anyways - I'm also doing the highlighting of current menu item on server (adding a selected class/css to an item). Highlighting with javascript is not good option, because there is content in datagrids, that causes postback and needs to remain the menu in the same position as selected value is.
So I am doing this as some kind of mapping with a hashtable (e.g. pairs (url-of-the-site, menu-item-to-highlight)), and i have to include a mapping for every site my web application contains in order i want to have menus highlighted... so somehow it bothers me that there has to be a better way to do this. are there any better techniques?
A technique I use on my master page/content pages with .NET 2.0 is to have a publicly accessible method called "SetNavigation" that takes a string character that correlates to the hyperlink control I want to highlight. What the method does is set the CSS stylesheet of the specified hyperlink to my "selected" one.
Then in my child pages, in the Page_Load method, I call the SetNavigation method and pass in the link based on the current page I'm on, such as SetNavigation("hypSearch")
I would gather that you could create a similar control on your ASCX control and then have your Page_Load events, or even button click events call the method if so desired.

Resources