|
window.open("MyUrl.aspx","srch",'toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,status=0,resizable=1,top=10,left=10')
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
thanx for ur reply.... but it dint works.... i'm using C# in ASP.NET 1.1....
would tat works for it..?
|
|
|
|
|
Sorry, should've been clearer. It's a little bit of javascript. You have 2 options - either in the markup of your page, put a script tag with a function defined that just calls window.open, or alternatively, you can use the Page.RegisterStartupScript or Page.RegisterClientScriptBlock to emit it to the page, and it will then be run at the appropriate time.
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi all,
I have a Project due after one week. It is a web service project. I have a Web Form which communicates to the web service and this web service communicates to the database. I have all my SQL statements in the Data Acess Layer to create more secure web service application. The Web service class is also in the Data Access Layer. I need to populates the 4 Dropdown list boxes on the web form from one table. I have Customer table which contains information About CustomerName, CustomerType, Address, City. These 4 colum values should populate the 4 Dropdown lists. And then I need to implement those 4 dropdowns like this. When the user selects a Customername it should display relevant customer information in the GridView. Or when the user selects values from all 4 listboxes it should display all information on GridView as well.
For all the above I have just populated one listbox but I don't know how to populate the other 3 dropdown lists and implement them on the web form.
I have created one method in the Data Access Layer class and one method in the Web Service class and then I instaitiated the web service object in the web form by adding a web reference. It works fine for just populating one dropdown list box but for the whole 4 dropdown list I am unable to populated and Implement them.
Below are the methods and the code for one dropdownlist.
(1)Web Form code:
WebService.Service ws = new WebService.Service();
protected void Page_Load(object sender, EventArgs e)
{
object[] alist;
alist = ws.GetBusinessType(string.Empty);
DropDownList1.DataSource = alist;
DropDownList1.DataBind();
(2) Web Service Method:
[WebMethod]
public ArrayList GetBusinessType(string btype)
{
DAccess ODA = new DAccess(); //Data Access object
ArrayList list = new ArrayList();
list = ODA.GetBusinessType(btype); //Data Access method
return list;
}
(3) Data Access method:
public ArrayList GetBusinessType(string btype)
{
SqlConnection connection = GetConnection;
try
{
ArrayList arrbt = new ArrayList();
StringBuilder sql = new StringBuilder()
.AppendLine("SELECT")
.AppendLine("\tTYPENAME")
.AppendLine("\tFROM")
.AppendLine("\tBUSINESS_TYPE");
SqlParameter paramTYPENAME = new SqlParameter("TYPENAME", SqlDbType.NVarChar);
paramTYPENAME.Value = btype;
connection.Open();
SqlDataReader reader = ExecuteQuery(connection, sql.ToString(), paramTYPENAME);
while (reader.Read())
{
string result = reader["TYPENAME"].ToString();
arrbt.Add(result);
}
return arrbt;
}
catch (Exception ex)
{
return null;
//do some log here Call a class that logs the errors
}
finally
{
connection.Close();
}
All the above code works fine for just populating the one dropdown list but not implementing. I just want the implementation something like....When the user select one dropdown or all of them then it should display the result in the gridview. I have not shown the aspx code here but the main thing is the code above. Can any one help me to implement this
I really appreciate your help. Looking forward to your reply.
Thanks
Koonda
|
|
|
|
|
Hi,
According to me u should create event handlers to handle "SelectedIndexChanged" event for all your dropdownlists and should write code there to bind the gridview.
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Thanks Chetan Ranpariya,
But the thing is I have a Display button below the 4 dropdowns and when I select each dropdown and click the display button it should display all the relevant information. I have populated the dropdowns but the question is how to implement them through the Web Service. I have a method in my Web Form which calls a method in the Web Service and this Web Service method calls another method in The Data Access Layer which has all the SQL stuff. But I have problem of how to Implement the Data Access Layer in order to get the values from Database and return it to Web Service and then the Web Service return it to the Web form and it is displayed there in the GridView.
Could you send me any code examples that would be very nice.
Thanks a lot for your help and looking forward to your reply.
Koonda
|
|
|
|
|
I have created a web page using C#.net 2005. The web page contain a textbox which is disabled. And the web page contain a button, after clicking the button, there will be a pop-up window containing calender. When the user select the date in calender, the window will be closed and return the selected value back to the textbox which is disabled. The date will appear on the textbox but after refresh the value is missing.....I cannot figure it out... Please kindly help. I deeply appreciated for your help.
|
|
|
|
|
When a form field is disabled, it won't be included when the form is posted. If you want the data to be sent to the server, you have to put it in a field that is not disabled. You can for example put it in a hidden field.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi
Modify your page 'form' tag like this..
'submitdisabledcontrols' is new feature in ASP.NET 2.0
Hope this Helps
Thanks..
|
|
|
|
|
am Using a TextBox and ListBox Under Update Panel (control of asp.net ajax). I am Populating the Listbox according to the text in textBox.
I have declared Onchange Event of textBox and in that function I have Populated the ListBox.But How can I do the same task with onkeydown event
or onkeypress event of TextBox? As there is no server event named onkeydown or onkeypress exists ?
monir
|
|
|
|
|
You need to use javascript for keypress event
|
|
|
|
|
I'm looking for a web library/control that will allow me to Resize, Convert and Save images to disk or DB upon submit. I'm running a site where users can submit photos and I want to convert them all to WIDTH x HEIGHT and if the are anything other than JPG/JPEG convert them to be JPG.
Anyone have suggestions for a product they have used?
Thanks,
Rex Winn
|
|
|
|
|
Assuming that you're getting images in the common formats, png, bmp, gif, etc, then you should find that there's not much work in writing this yourself.
I assume you don't want to enforce both width and height, or you'll change the aspect ratio of images ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Hey! I understand that enforcing those constraints will affect the aspect ratio. In this case if things don't look right a sales representative will follow up with the submitter and assist them and scaling the image or capturing a better aspect image. What's hard is the images will be uploaded for an advertisement into a set region.
When you say, "not much work" I believe you but... the hard part for me is doing something that's been done, charging $2000 for it when if I had searched better I could have found a component for $199 that did all that and more.
How much effort do you think this would take and can it all be done from within the framework or will other COM/Assemblies be required?
My name is Maximus Decimus Meridius, Commander of the Armies of the North, General of the Felix Legions, loyal servant to the true emperor, Marcus Aurelius. Father to a murdered process, husband to a murdered thread. And I will have my affinity, in this life or the next. - Gladiator. (Okay, not quite Gladiator but close.)
I work to live. I do not live to work. My clients do not seem capable of grasping this fact.
Ancient of days! august Athena! where, Where are thy men of might? - Lord Byron
|
|
|
|
|
code-frog wrote: What's hard is the images will be uploaded for an advertisement into a set region.
In that case, I'd write code to make it fit, i.e. put a white area on the left and right or top and bottom if the aspect ratio is not right.
code-frog wrote: When you say, "not much work" I believe you but... the hard part for me is doing something that's been done, charging $2000 for it when if I had searched better I could have found a component for $199 that did all that and more.
That's a fair point. What you're asking for, looking like 1-2 hours work to me. If you get paid that much, I'm happy for you to subcontract to me at half your hourly rate :P
It's entirely possible that such components exist, and I don't know about them. I do use the Atalasoft imaging library, for other stuff, perhaps their base version does some of what you need ?
code-frog wrote: How much effort do you think this would take and can it all be done from within the framework or will other COM/Assemblies be required?
The framework is absolutely the best place to be doing this, resizing an image is obviously trivial, and saving as JPEG is supported by GDI+ as well, a COM component probably exists, precisely because it was so hard to do this stuff in C++.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
I'll check out the framework. I guess I'm used to the old days when Win32 basically gave you the raw functions but you had to bring in the magic.
My name is Maximus Decimus Meridius, Commander of the Armies of the North, General of the Felix Legions, loyal servant to the true emperor, Marcus Aurelius. Father to a murdered process, husband to a murdered thread. And I will have my affinity, in this life or the next. - Gladiator. (Okay, not quite Gladiator but close.)
I work to live. I do not live to work. My clients do not seem capable of grasping this fact.
Ancient of days! august Athena! where, Where are thy men of might? - Lord Byron
|
|
|
|
|
The one trick is getting to set the quality setting on a jpeg.
http://support.microsoft.com/kb/324790[^] is a link that shows you how to do that. As a result, it also shows how to save JPEG files To resize them, you just use Graphics.FromBitmap ( or FromImage ? ) to get a graphics object that contains a bitmap ( which you first create, to the right size for you ). Then you use the Bitmap.FromFile or the Bitmap constructor that takes a path to load your file, whatever it is, and a variation of teh DrawImage method on the graphics class that lets you set the position and new size. The rest is just some simple math to work out where to draw the image so it's at the correct aspect ration and within your fixed bitmap.
I believe the bitmap class has a method that is used to paint it all your background color, or FillRectangle will work just fine.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
I have an ASP.NET website created, code behind is in C#. It talks to an access DB (I know I know... should be using SQl, but the U.S. Govt. wont let me!) is there anyway to give a user and option to download my database? I keep having issues, because the LDB file created...
|
|
|
|
|
Create a directory outside of your application and copy the Access database there. Give the ASPNET userid on the server just short of FULL NTFS access to that directory. That should take care of the LDB problem.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I wont have an option to do a copy of the DB over, the database is being used as a data collection event, my functional users are going to be out of the U.S. to collect data, as well as I the computer programmer, will be out of the country, now our website since it's on a govt server, I cannot FTP, ftp is disabled, while the possiblity of having VPN back to our servers, is a possibility we can't gurrantee that.
|
|
|
|
|
Well, you can have the Access database file uploaded. However, if your users need to make modifications and download it back. That sounds like a synchronization nightmare.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
No they will not need to upload anything. They will have access to our website, that is were my data collectors are inputing data, then, through out the event, we have to provide a copy of the data that we have collected so far, to some of the anaylst from another company, they are then going to take our DB, and do some analyst stuff on it. They will never give it back, and they will need a fairly constant update of it.
|
|
|
|
|
No one has any other ideas?
|
|
|
|
|
Hi,
Insted of allowing user to download live database you can provide facility to dowonload backup.
You can write code to take backup at every some period of time and store that to some place on the server and provide the user with link to that location to download the database.
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Guys,
I am using Drag and Drop Login control and
Sql Server Database (as deafult) for storing all the info..
is it possible that i could put the username logged into session as, i want to control the webpage control by username...
for example :
USER 1 can see BUTTON 1
by chking Sesssion["xyz"] == "USER1"
button.visible = false;
Hope i will get sol..
thanks and regards
govind
|
|
|
|
|