As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
My requirement is
Should have a option to attach file in each row of a repeater
Once I clicked to upload, I have to pass a id and need to execute the insert query
Is there any way to do this using ajax asynchronous?
The IDs of the uploader controls are going to be generated dynamically so you're gonna run into the challenge of identifying which upload control it is that you're trying to get a file from. The way I accomplished this was to use jQuery to find the nearest upload control to the button that was clicked. To "tag" the controls, I assigned a dummy css class that could be selected by jQuery. From there, you can build a JSON object to pass to your service or page method for the processing of your insert operation.
There are other options to handle submitting ALL uploader controls, of course, but you weren't very clear on what you've tried or what the bigger picture here is. You didn't give any specifics in your question, so I'm not giving any specifics for an answer. This is just offering a path to take. Good luck.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
When it is a users first time visiting a certain part of my web app I want to present a brief modal FAQ to them. We are using .Net MVC on this app, so I know I can accomplish something similar to this using cookies in Javascript with a long expiration date. But, I'm curious if there is a better way to implement this since cookies can be cleared from the browser by the user. I would guess C# or razor would provide me with a more elegant solution. Thanks for any advice!
If the user is authenticated, why not store this information server-side (like in a database)? Then you can communicate the "flag" to the View (via the Model or ViewBag) so it can decide whether or not to prompt with the FAQ.
public ActionResult Index()
{
bool isUsersFirstTime = IsFirstTime(); // Do something to read this value from the database
if (isUsersFirstTime)
{
UpdateFirstTimeFlag(); // Do something to update this value in the database
}
ViewBag.FirstTimeUser = isUsersFirstTime;
}
Then in your view, something like (assuming Razor syntax):
#if (ViewBag.FirstTimeUser)
{
<div>Here's the modal FAQ</div>
}
Obviously, if you're implementing more of an MVVM approach, you'll want to put the FirstTimeUser property in the ViewModel and reference it in the view with Model.FirstTimeUser.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I'm asked to build a simple web site. Every page of this site is mainly text. I want them to be able to change all the text dynamicly.
What is a better way:
1) To store all the text in database.
2) On text change replace existing aspx file with new one with changed text.
I would prefer a way where the changed pages will load faster on client side
Given these requirements, your best solution is a CMS (content management system).
There are plenty of options for asp.net, like Umbraco, DotNetNuke etc.
Doing this by storing all the text in the database will be just like implementing a CMS. The second option is really really old school. You may as well put static html pages on the server in that case.
You should change text in the controller. Don't replace pages.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am trying to put together a solution for our office to map the cubicle and office layout. We currently have both php and C# applications, so the solution can be built in either. We have something in PHP already, that allows us to move people from one cubicle to another, but it is based off a static image size and point coordinates. For example, cubicle one is at (3px, 4px). While this solution is working, it doesn't allow for the image size to change, or for the image to change at all without significant coding to realign all of the points on the image. Is there a better solution that can be used or an open source library that would be helpful? A coworked suggested that the Google Maps API might be helpful, or Leaflet.js. However, these both use geocoding, so unless our current Lat and Long is accurate to like a foot, I don't see how these could help.
Thanks for any suggestions.
Update
Here is an image similar to the one we are using. We add absolutely positioned clickable divs over the image to show who sits there.
What your co-worker suggested is not so much the GMaps API itself but the implementations of rotations/geosync translation/zoom algorithms that would allow you to flip an image and all the points related to the image.
No specific code implementation, so I can't be more specific.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I need the customized Texbox like the below in Silverlight or Windows Phone platforms. That will be splitted based on the mask which has been applied to the control. I was looking over the internet and did not find anything.
I guess you cannot get away without creating a custom control. If you say split should be based on some mask, then, I guess, there could potentially be any number of text boxes inside, i.e. from 1 to unlimited (theoretically). Then you probably need to consider moving input focus between fields based on user input. Based on all this, custom control is what you need. If you have no previous experience with custom controls in WP or Silverlight, I suggest you to take a look here.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I need to develop a desktop application. It has to connect to a website and click a 'Submit' button on one of its pages. Basically we have to read a excel sheet (contains invoice numbers),for each invoice number need to hit the 'Submit' button.
Now I have read we can use webbrowser controls , but my requirement is the website should not be opened in the browser , it should all be done internally without opening in any browser, Connect to website , fetch each number and hit a submit button.
Any pointers on this would be helpful.
it is a good idea to use web service for this IF you can deploy the web service to the website.
if not, you will have to use the web browser control. the web browser control does NOT have to be on the form. you can create a web browser object on the fly. check
WebBrowser Control in a new thread
but, web browser usually has more overhead.
instead, you can use fiddler to sniff the traffic and use httpwebrequest/webrequest class to do this.
You could use the WebRequest class to post the data. See this:
http://www.netomatix.com/httppostdata.aspx