|
Hello All,
I am a newbie to .NET and SQL...have been hiding under the rock of Ph.D. studies...
I have a ASP.NET web page with a GridView control on it and I want to display the total number of records in the whole table. I am a newbie to .NET, Databases, SQL, and ASP.NET.
I've seen this posted elsewhere, however I can't make sense of the answers because they assume familiarity with databases. I don't know my DataSet from my DataView from my elbow. If anyone would be willing to give me a hint, I would be greatly appreciative.
Thanks so much.
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|
|
My crystal report viewer control has the toolbar enabled, and I fixed it so the images now display.
When I click the Export or Print buttons, nothing happens. I don't see anywhere to override their function either.
I notice many sample report pages contain a separate Print button which handles this. I'd avoid this if possible.
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
There is formA.aspx having grid and many controls. Now, there is another requirement that there needs to be another textbox and button on top of the form on the basis of which the formA will be populated. This should be formB.
I dont want to add everything on formA into formB. Just want to call formB from formA without redirecting to another page.
How can I do this without using usercontrol becoz this is just needed once and putting it as a user control will be my last chance.
Can you suggest simple method other than going for MDI?
Thanks
|
|
|
|
|
There's no such thing as MDI in ASP.NET. Just add the textbox and button and set their visibility. Or make the user control, it's not hard.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
can anybody plz help me find errors in this code. i am trying to send an email but i really cant. i cant figure out why..
protected void btnSubmit_Click(object sender, EventArgs e)
{
MailMessage message = new MailMessage();
message.To = txtTo.Text;
message.From = txtFrom.Text;
message.Subject = txtSubject.Text;
message.Body = txtBody.Text;
try
{
SmtpMail.SmtpServer= "localhost";
SmtpMail.Send(message);
litStatus.Text = "Your email has been sent";
}
catch (Exception ex)
{
litStatus.Text="Error sending email";
}
}
}
kaaj
|
|
|
|
|
SmtpMail may require a user name and password as well as a valid from recipient. Also, is your local IIS setup as SMTP?
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
SmtpMail is obsolete in .net 2.0.
Maybe try using the SmtpClient instead. So...
<br />
SmtpClient client = new SmtpClient( "localhost" );<br />
client.Send( message );<br />
|
|
|
|
|
i think these modifications will make it work
protected void btnSubmit_Click(object sender, EventArgs e)
{
MailMessage message = new MailMessage();
message.To.Add(new MailAddress(txtTo.Text, "any user Name");
mMail.From = new MailAddress(txtFrom.Text, "any user Name");
message.Subject = txtSubject.Text;
message.Body = txtBody.Text;
try
{
SmtpClient sm = new SmtpClient();
sm.Send(message);
litStatus.Text = "Your email has been sent";
}
catch (Exception ex)
{
litStatus.Text="Error sending email";
}
}
}
in web.config, configure smtp
think this shud work
CST
|
|
|
|
|
I have been scouring Google for an answer, and cant seem to get a simple one. I am very familiar with using threadpool.queueuserworkitem with windows forms. I have a clear understanding of using delegate methods when interacting with an object that doesn't necessarily belong to the various threads, say each thread is building a row of a datatable
However, I have been having a hell of a time finding code that will do this for asp.net. does anyone have a working example of a multithreaded web app, or could point me in the right direction?
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Use a call back or an asynchronous page. However, be very careful, threading in an ASP.NET application needs a very specific intent and purpose. Normal thread logic does not apply.
In fact, I would recommend against it in 99.99% of cases.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
all of my tests have blown up in spectacular fashion, so I am awar eof the dangers
the page i am writing is running, then getting the html from a particular page perhaps hundreds of times. the idea so far has been to allow me to re-use an exisiting page in our app rather than rewriting the code from it in a new page that would then repeat it.
It works like this:
we have a page that uses a querystring to request information from the db. it has a specific formatting to it. The project i have been assigned is to runa query with specific parameters, and then build a page that is a composite of all the pages that "would" be generated by the query results if they were run individually, have them marginally reformatted to break for each printer page, and then launch the print window via javascript.
this is pretty monumental to begin with, but the way i have built it so far runs the query, then loads the "other" page and scrapes the body of it and adds it to a datatable. This works great, except when i run the full query, it takes 20 minutes to load the page. Obviously, this is unworkable. I would like to launch each item in a thread and as they finish rendering, add them to the datattable, then return the whole thing.
does that sounds like a good candidate?
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
A query that takes 20 minutes is likely in error.
If you insist on this track then I would suggest you need a temporary storage medium for the results, ala session. Then you can poll the session with either ajax or an asynchronous page to update the data table.
I, however, would rework the query.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
the query is actually lightning fast, its building the page after the fact that is taking forever.
However, my boss gave me the best solution:
Let them wait. Apparently this thing will run once a month, so they can just deal with the wait.
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
rotflmao. Can you generate it offline then? Maybe a Windows service that runs and persists it so that the user can just select already rendered packages?
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
If i had it my way, it would probably just be a console app that ran once a month and output a big html file, but it isnt up to me, so i guess they get to wait.
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
I have an asp.net page with a calendar control. When the user selects a date in the calendar i dynamically create a changing number of checkBoxes. In this page i also have a button which is supposed to read the values of the checkBoxes. The problem is that page_load fires before my button's click event, and in the click event handler the checkBoxes don't exist so i can't check their values. I tried to save the checkBoxes info in the Session after the date has changed, but that gives me their original values and not the values the user changed before he clicked the button.
Hope i made myself clear enough and you'll be able to help me.
Thx
|
|
|
|
|
Where do you create these checkboxes? on client using JavaScript or on the server?
Can you post some code to make it easier to help?
|
|
|
|
|
I create the checkBoxes on the server, in the SelectionChanged event of the calendar. The processing of the information they hold needs to be done on the server too.
The button is created in design time (not dynamically), but it's not visible at start. It becomes visible in the same SelectionChanged event of the calendar. A click on it should be able to access the values of the dynamically created checkBoxes, but the problem is that when the button click event handler is called, the page doesn't contain the checkBoxes any more.
|
|
|
|
|
hi
write the code for dynamically creating checkbox in a function
and call this function from both in form load each time and in button click
|
|
|
|
|
The checkBoxes build (amount, values, etc) depends on the selected date in the calendar. I can't build the checkBoxes on page_load because i don't know what is the current date in the calendar (the page_load events occurs before the SelectionChanged of the calendar, so the calendar doesn't hold the pressed date in page_load)
|
|
|
|
|
hi
have u tried it
it must work
do some logical things
it will work when u call the function from page load
i have use this many time
|
|
|
|
|
I tried what u suggested, but new problems popped out. So i replaced the checkBoxes with buttons and then applied your suggestion and apperantly it was much easier.
Thanks alot.
|
|
|
|
|
Hi Everybody,
I am completely new for ASP.net. I want to print the data manually in grid using while loop. is it possible or not. please help me.
Thank you,
Uddhab
|
|
|
|
|
I have an ASP.NET custom control in a class library, which (apart from server-side logic) has client-side functionality. As far is I know this is best achieved by adding the javascript file to the project as an embedded resource and registering it via code, like this:
string scriptLocation = Page.ClientScript.GetWebResourceUrl(this.GetType(), "Namespace.Control.js");
Page.ClientScript.RegisterClientScriptInclude("Namespace.Control.js", scriptLocation);
Now the funny thing is, it works as expected on one site, however if used on a page in a second site that uses the same class library, I get the following Exception:
"This is an invalid webresource request.". Google only came up with solutions for cases, where it doesn't work at all. Right now I have absolutely no idea what could cause this different behavior for the 2 sites. Any comment on the subject would be appreciated.
|
|
|
|
|
Hi all,
I have a user control with one datalist that displays thumbnails of pictures stored in the database. In the same user control, I have an Image control where I would like to display a zoomed version of the picture when the user clicks on one of the thumbnails of the datalist.
In the datalist, I have ImageButton controls to show the thumbnails. When the user clicks a thumbnail, I get the item index and retrieve the corresponding image from the dataset in the session. The image is stored as a byte array. I save the image in another session variable that will be used by an ASPX page to display it. I point the ImageUrl of my Image control to that ASPX page.
The ItemCommand event handler is as follows:
protected void dlVisuals_ItemCommand(object source, DataListCommandEventArgs e)
{
int index = e.Item.ItemIndex;
DataRow dr = sessionParams.SiteDS.Tables["TempVisuals"].Rows[index];
Session["VisualZoom"] = SiteServices.GetThumbnail((byte[])dr[2], 300, 300);
imgZoomFeature.ImageUrl = "ZoomVisualImage.aspx";
imgZoomFeature.Visible = true;
}
The aspx code to show the image is as follows:
if (Session["VisualZoom"] != null)
{
Bitmap bmp = new Bitmap(new MemoryStream((byte[])Session["VisualZoom"]));
bmp.Save(Response.OutputStream, ImageFormat.Jpeg);
}
I have put the datalist AND the Image control in an UpdatePanel and set the trigger to the ItemCommand event of the datalist.
The code works fine for the FIRST click only, i.e. when the user clicks on a thumbnail after the user control has been loaded. Subsequent clicks do not have any effect on the Image control. I have stepped into the code and I verified that the event handler is being called correctly at each thumbnail click. It seems that the ASPX page displaying the image is not working properly. I put a breakpoint in it but the program doesn't stop at it.
Any ideas?
Thanks,
Talal
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook
|
|
|
|