|
|
I am running into a problem here, and I have no code needed or that requires debugging. I am looking for more of an idea to solve this issue, so here it is.
I have a *.exe that is a command prompt utility that generates images. What I am doing is using this utility for my asp.net website. In the background I do processing for each date in a asp.net calendar. If the image doesn't exist in the images directory for that date, Calendar_DayRender calls the backend to use the exe via Process. The image creation works great. As does the loading, if the image was already created in a previous session by any other user.
The problem is that the images are being created too quicky and I cannot load the image because when I try to add the Image to the cell, it was not created quickly enough. Any ideas on how I can solve this timing issue?
|
|
|
|
|
Check for the existence of the image file in the main thread before you send the reply to the client.
|
|
|
|
|
Make the image request synchronous? How are you requesting the image in the first place? If you do it with a tag, the browser should wait for a response.
I've done this in the past...
If the myImageGenerator.aspx page streams back an image, the browser will display it. I learned this technique from an OLD article on here about Captcha - the image streaming technique is still valid.
A CAPTCHA Server Control for ASP.NET[^]
|
|
|
|
|
I have been creating a smaller scale MUCH SIMPLIFIED version of a registration system that assumes classes are taught once a week. This system already checks if a teacher has taught 3 classes to not select him for further classes. But I need to make sure it also checks that the room is not already chosen for a class previous during the time it wants.
What I have so far selects rooms and shows them in a drop down list, but I am able to make it show all room less everything chosen so far but it does not take into consideration the time and day of the week and so it is eliminating anything chosen, not just for the day of the week and the start_Hour and end_Hour times.
string commandText1 = "SELECT * FROM tblRoom WHERE NOT EXISTS (SELECT * FROM tblClass WHERE tblRoom.room_Num = tblClass.room_Num)";
var ds1 = new DataSet();
using (var connection = new OleDbConnection(connectionString))
using (var command = new OleDbCommand(commandText1, connection))
{
command.Parameters.AddWithValue("@p0", ddlRoom.SelectedValue);
var adapter = new OleDbDataAdapter(command);
adapter.Fill(ds1);
}
ddlRoom.DataSource = ds1;
ddlRoom.DataTextField = "room_Num";
ddlRoom.DataValueField = "room_Num";
ddlRoom.DataBind();
ddlRoom.Items.Insert(0, new ListItem("Please Select", "0"));
ddlRoom.Items.Insert(1, new ListItem("TBD", "TBD"));
}
}
tblRoom consists of tblRoom.room_Num (Key) TextString with Room#
tblClass consists of tblClass.room_Num (FK) TextString,
CourseID (FK) from tblCourse, week_Day which is the Day Of the Week (Monday, Tueday, Wednesday, Thursday, Friday or Saturday). start_Hour and end_Hour for when the class begins and ends.
What I am looking for is to improve the select command above so it can use week_Day = ? (ddlweekDay.SelectedValue) start_Hour (ddlstarthour.selectedvalue), end_Hour (ddlendHour.SelectedValue) OR to "remove" it from the drop down after it populates but before it shows the user. Hence perhaps a subroutine it can run called checkavailablity() where it might pass these parameters when all the time fields have been filled out or something. I know I can remove a line from the drop down and do it by naming the courseID or something? This is at least my next approach idea.
This is a very simplified version and has simple assumptions, not need to over think this. There is no gym class, and each class room is just that a class room. I just want to be able to schedule the classes -- not adding students as yet.
|
|
|
|
|
Seems difficult to give you a precise answer without knowing more about the database.
From my point of view, but I might be biased as I come more from a SQL background than many, I would create a SQL View, taking parameters (stored procedure) returning all ClassRooms available between 2 datetime (start and end), and I would do my select against this view.
Also, as I guess classes starts and end at a fixed hour, instead of using a whole datetime twice, I would build a fixed table with ID values, for example, from 8 to 8:45 AM = #1, from 9 to 9:45 = #2, and so on...
Just some ideas....
|
|
|
|
|
I am brainstorming ideas for an web browser WYSIWYG text editor for LED like displays. The editor will show a matrix of bulbs. As the user types, the bulbs corresponding to the keys pressed will be turned on. The editor will support backspace and most basic text editor functions. The displays are also of different sizes (pixel height, width, etc) and support different fonts.
I've seen where javascript supports key up/down events. What I am focusing on right now is the edittable pixel display.
The two ideas I have right now are
1) A table with each cell filled with an OffBulb.png. As the user types, javascript determines the appropriate cells to be changed to an OnBulb.png.
2) The server creates .png for all supported characters (~200 chars - a lot of images) and as the user types, the character pngs are layed out in the container one after the other.
Does anyone have any ideas?
The platform will be .NET either MVC or possible WebForms.
|
|
|
|
|
You mean a look-up table right? You put your 200 characters in an array of objects which each hold the name of the character and the image for the character. THAT array NEVER changes!
When the user enters the characters they want, you create an array for the user input, but don't copy the values from the 200-character array - copy the indexes. So, in memory, the message looks like this...
53 41 4c 45 20 6f 6e 20 44 56 44 73 20 54 4f 44 41 59 21 - which I would bet is exactly what the sign stores too.
So "the character pngs are layed out in the container one after the other." isn't the right way to do it - just put the reference numbers in there. Making copies of the character set is wasteful, and LED signs don't have a ton of memory - you should emulate that behavior in your web interface.
And when you're done... please fix Bubba Chino's sign... it has been flashing "LED SIGN!" for two years ever since he bought it
|
|
|
|
|
Hi Everyone,
What is the difference between DBContext class and ObjectContext ?
|
|
|
|
|
|
hello Friends
i made a asp.net page that accepted rss address. now,I want to read the content of any links that exist in rss for this action i writed follow code:
protected void Button_Rssreader_Click(object sender, EventArgs e)
{
var reader = XmlReader.Create(TextBox1.Text);
var feed = SyndicationFeed.Load(reader);
reader.Close();
string s = "";
foreach (SyndicationItem i in feed.Items)
{
s += i.Title.Text + "<br />" + i.Summary.Text + "<br/>" + i.PublishDate.ToString() + "<br />" + "<br />" + (i.Content as TextSyndicationContent).Text.Trim();
s += "<hr />";
}
Literal1.Text = s;
}
But i can just see the summary of RSS link if Delete (i.Content as TextSyndicationContent).Text.Trim()
i want to see the links of picture beside summary in the Rss link
Point : id don't want to see the link of picture that is in the XML links. really i need to read & download the Rss Links of picture to Display them beside the news (text ).
|
|
|
|
|
|
I am trying to say if a teacher is already teaching 3 classes flag it by returning a true if so, or a false if not. I have it counting the rows (or so I thought), but it is saying the way I did it is not correct. That Tables[0] is invalid.
private bool ValidateTeacher(string TeacherID, String Semester)
{
string path = Server.MapPath("eAcademy_DB.mdb");
string connectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" + path;
string commandText = "SELECT COUNT(*) FROM tblClass WHERE emp_ID=? and sem_Time=?";
var ds6 = new DataSet();
using (var connection = new OleDbConnection(connectionString))
using (var command = new OleDbCommand(commandText, connection))
{
var adapter = new OleDbDataAdapter(command);
if (ds6.Tables[0].Rows.Count > 3)
{
return false;
}
else return true;
}
}
|
|
|
|
|
You have to fill the DataSet before you read from it.
adapter.Fill(ds6, "Teacher");
|
|
|
|
|
You are just creating an adapter and a dataset. You have fill the dataset using the adapter.
adapter.Fill(ds6);
or
adapter.Fill(ds6, "<Your table name>");
|
|
|
|
|
I have just started to learn C# and Asp.Net and I have a specific project in mind but I need to be able to manipulate cookies client side and I can't find good documentation for this so I decided to ask for help to get a starting point.
I want to make a desktop application that is a little to complex for my actual knowledge but I need a starting point: I need to be able to load a list of usernames and passwords and proxies and proxyuser and proxy pass. This little part of the application will use the accounts and proxies to login to a webpage using httpclient. When I send a GET request to the login page I get back a response that contain some hidden parameters that I must assign to some variables and a cookie. I don't know how to save that cookie in a location that I choose (the application folder under the "cookies" folder) with the name that I choose (the username used for login should be the name of that cookie). After I sort thru the response I have to send a POST request to the server with all the hidden parameters and the user and pass parameters and the cookie. The server will send back a response with another cookie that I want to save in the same location as the first one with the same name (overwritten ). This cookie will be used later in the program to do other actions on that server under that login. All this requests must use a certain proxy with its credentials, proxy that will change every time I use a new login.
I managed to find out how to use the HTTP Client from Asp.Net Web API to send the get req or to post but I have no idea how to get such a control over cookies that the site want to store on my computer and how to use different private proxies for each login... I did all the above using PHP and CURL and is very easy to control the cookies using cURL but I need to do it in C# and make a desktop app so ... Asp.Net Web API and HTTP Client is the key I think...
Please give me a hand to start my project and don't dismiss my question just because I'm to noob with .net or c#
Thank You!
Florin Curelaru
|
|
|
|
|
i Would like to know the code for resizing the webpage according to the screen size or the screen resolution please help me.it can either be using css, javascript or html
|
|
|
|
|
This is called "Responsive Design" meaning the web page responds to different device sizes...
Now that you know what it is called, you should be able to research the subject yourself. It is complicated, and you're going to have to make the decisions yourself about how to approach it for your situation...
https://www.google.com/?q=responsive%20web%20design[^]
|
|
|
|
|
Thank you Jasmine2501
|
|
|
|
|
"screen size" is not OK: do you expect all your users to run their web browsers maximized? I don't - and I get annoyed by some stupidly designed web pages assuming that they can use 2560 pixels wide (or sometimes even 4480 pixels, since I have two monitors). The client size of the browser is the correct value!
|
|
|
|
|
I am not looking for any browser pixels i was looking for a page which does not show much of a whitespace.......please read the post properly....
|
|
|
|
|
If you adjust for browser or, screen size, you will still need to think about printer friendly version of your web pages.
|
|
|
|
|
hi everyone,
i'm having a problem like i have gridview control with
4 columns and column1 is a text column and col2 is flag column where as col3 and col4 are item templates where a textbox is embedded in each of the item templates, col1 text and col2 values
are comming from oracle ref cursor, based on the flag condition of col2 coming from ref cursor we need to display the item template with textboxes in col3 & col4 and how to validate those boxes in item template when submitting data to the database meanwhile we need to convert the data into an xml format to store the data to the database ,if anyone who understand my problem are invited to answer.
thanks in advance,
jeeva
|
|
|
|
|
I have some data from model , in which i getting some hex values .. now i need to translate this hex values to real color.
I have try this way...
@Html.DisplayFor(modelItem=>System.Drawing.ColorTranslator.FromHtml(item.color))
But this not working.
item.Color is a value from database and it's like this #ffffff;
Any suggestions ?
Thanks for help in advance!
|
|
|
|
|
try this
<span style="display: inline-block; width: 20px; height: 20px; background-color: @item.Color"></span>
it would display like this:
Help people,so poeple can help you.
modified 29-May-13 1:54am.
|
|
|
|