|
javascript has no idea what a desktop is, and sure is not allowed to wander the clients file system. You can't do it.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Can you tell what class or function I need to use to get the "Save As" dialog box to pop up when the save button is press in ASP.Net using C#? Thanks.
|
|
|
|
|
|
Hi,
I am using window.print() to print the current window from Asp.net(VB) but now i want to set page size,printer name ,Orientation etc Programatically
Please help me.
Darshana Pathak
|
|
|
|
|
u can set printer settings from the dialog box that comes when window.print is invoked... Check Properties...
You cant change the default settings of the PRint dialog box from code. Its because of security issue..
But there is a way for IE users to call WScript.Shell. try out the code:
<pre>var shell;
function SetPrintProperties() {
try {
shell = new ActiveXObject("WScript.Shell");
shell.SendKeys("%fu");
window.setTimeout("javascript:SetPaperSize();", 400);
} catch (e) {
alert('Please verify that your print settings have a Landscape orientation and minimum margins.');
}
}
function SetPaperSize() {
shell.sendKeys("%a{TAB}.2{TAB}0{TAB}0{TAB}0{ENTER}");
}</pre>
But I dont recommend this as its browser specific and not a good practice to change settings without users consent....
Abhishek Sur
|
|
|
|
|
i tried it but its not working
Darshana Pathak
|
|
|
|
|
JS can't do this. Might be some activex controls can do.
|
|
|
|
|
Hi all,
In my web application i need to show a small message using a div in user registration form,message mean when user while moving to textboxes to insert data div should focus infront of that purticular textbox(message should dynamically change).Pls help me to do this
Thanks
|
|
|
|
|
tell me what is the problem with this...
just set the position of the div correctly using Style="left:##px;top:##px;Z-Index:#" of the div using Javascript on focus... and u are done...
No problems with this.... Simple as water
Abhishek Sur
|
|
|
|
|
Thanks,This working fine,but there is javascript error "Type Mismatch" in IE6.
Thanks
|
|
|
|
|
Hi All,
Simply i want to fetch gridview header row (heading in column) from button click
note that button is outside from that grid.
|
|
|
|
|
you can use this code
<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:ButtonField ButtonType="Button" Text="Button" />
</Columns>
</asp:GridView>
|
|
|
|
|
|
onbutton click
dim st as String
'check which is it's property Cells or Items
st=Gridview1.Rows(0).Cells(0).HeaderText
or
st=Gridview1.Rows(0).Items(0).HeaderText
'Here Cells(0) or Items(0) means the 0th index Column
So u have to do it for all Columns i.e.Cells(0),Cells(1),Cells(2),Cells(3).....
Darshana Pathak
|
|
|
|
|
Good Afternoon Guys
Let me start here. i have been Builidng Win App and this was an easy task there. Now i have a Page that has a Datagridview and am Displaying this from a DataTable Through a SP like this
Create Proc [sde].[Check_Active_Valuation]
as
select LIS_KEY,FUNC_KEY,
SUBSTRING(CONVERT(VARCHAR,V2.ADD_DATE,1),1,13)AS [ADD DATE]
,V2.NEW_IMPROVED_VALUE AS [MARKET VALUE],
SUBSTRING(CONVERT(VARCHAR,V2.EFFECTIVE_DATE,1),1,13)AS [EFFECTIVE_DATE] ,
CASE V2.VAL_STATUS_ID WHEN
1 THEN 'PREVIOUS'
WHEN 2 THEN 'ACTIVE'
WHEN 3 THEN 'PROCESSED'
WHEN 4 THEN 'COMMITED' END AS [STUTUS]
from sde.Property_Summary p1 INNER JOIN SDE.VALUATION V2
ON V2.PROPERTY_ID =P1.PROPERTY_ID
where 1< (select count(v1.val_status_id)
from sde.valuation v1
where v1.property_id = p1.property_id
and v1.archive_date is null
ANd v1.val_status_id = 2
AND V1.EFFECTIVE_DATE > '2002/07/01')
As you can see my SP, Value of Last Field am Displaying is Derived from the Value of that Field. So now, My Users Will see this on the grid will Previous ,Commited and Processed, and thats Fine, now i cant Edit that,i want my users to be able to Double Click and this Field should turn to be a Combobox and they Should Select the Appropriate between Previous , Processed and Commited, The Save part i can hendle.
Thank you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
You need to include the column (Lets call it StatusID) with the numeric values: 1, 2, 3, 4... in your select statement
For your gridview:
Add an edit column to the gridview
Convert the StatusID column into a template field
Go into edit templates (Edit mode for the StatusID column), insert a dropdownlist and remove the deafult textbox and add the items to this dropdownlist (value and text: 1 Previous, 2 Active...) or set its datasource to a select statement containing all your statuses
Bind the selectedvalue of the dropdownlist: SelectedValue = '<%# Bind ("StatusID") %>'
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" AutoGenerateEditButton="True" AutoGenerateSelectButton="True">
<Columns>
<asp:BoundField HeaderText="Col1" />
<asp:TemplateField HeaderText="Col2">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" SelectedValue='<%# Bind("StatusID") %>'>
<asp:ListItem Value="1">Status 1</asp:ListItem>
<asp:ListItem Value="2">Status 2</asp:ListItem>
<asp:ListItem Value="3">Status 3</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Alexei Rodriguez
|
|
|
|
|
I have a web user control that creates a graph based on values passed to it once it has finished it displays the control in the top left corener of the browser where as I would like to display it inside a <td> tag of a table. I have put the reference to the control on the page and added the usercontrol inside the <td> Like so:
<td colspan="6">
<uc1:LineGraph ID="LineGraph" runat="server" EnableViewState="false" />
</td>
But when I run the program it appears over the rest of the information thats meant to be displayed in the table and is in the top left corner.
Thanks for the help.
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
|
|
|
|
|
issue with text alignment and settings. Use relative rather than absolute points....
And if you are placing inside a TD then put all the rest of the Information also inside the table..
Dont write anything outside an position it using absolute position index.
Abhishek Sur
|
|
|
|
|
Using VS 2005, I used to be able to double-click on a control on an APS.Net page, and it would add a method to the .vb file.
Now, it changes to Source view mode of the .aspx file, and adds a <script> block with the method inside.
How do fix this? I have to keep deleting this crud from the web page and redoing it manually in the .vb file.
PS. I am NOT using HTML controls. I am using server controls.
Solution:
I found the problem.
From your suggestion, I created a new web app project. It behaved the same (putting code in the aspx file not the .vb file).
I asked a co-worker if he had the same problem. He did not.
We compared versions, and I did not have SP1 for VS2005.
After installing that, it works properly now.
Cheetah. Ferret. Gonads. What more can I say? - Pete O'Hanlon
modified on Friday, August 29, 2008 11:50 AM
|
|
|
|
|
You proberly changed one of you settings.
try tools\Options or tools\Customize you should find a setting in there to change what is happening.
|
|
|
|
|
did you deselected the checkbox while adding the webform called use separate file for Code.. or something similar... I think there is no codefile associated with that webform so it creates the code inside a <script runat="server> tag...
check it out.
Abhishek Sur
|
|
|
|
|
There is no option for separate codefile. It always creates one. I see that in tutorials and wonder what version they have.
So I have a Default.aspx, Default.aspx.vb, and Default.aspx.designer.vb
Drag a server control from toolbar to the form. Double-click it. I get that stupid <script> block in the source view of the .aspx file.
Cheetah. Ferret. Gonads. What more can I say? - Pete O'Hanlon
|
|
|
|
|
you just add a new WebForm, you will see there should be one checkbox called "place code in separate file" and also one thing, you dont have Designer as the file is partial in VS2005 and its stored within Application Data...
Note :If you have updated your project to VS 2005 SP 1 from VS 2002... your case may come...
Is it the case with you ?
I dont know if you have used VS 2002 ...
Abhishek Sur
|
|
|
|
|
Hello. Thank you for trying to help.
Did you read my posts?
I said: I am using VS 2005. I have no OPTION for separate codefile. IT ALWAYS ALWAYS ALWAYS USES SEPARATE CODEFILE. If there IS a SEPARATE CODEFILE, why is it putting code in the aspx page?
I can send a screenshot if you want.
Sorry for yelling, but you're the 4th person to suggest that.
Cheetah. Ferret. Gonads. What more can I say? - Pete O'Hanlon
|
|
|
|
|
well the problem with you may be you are using an existing project and converted to vs2005. I dont think you have made that project from start in vs 2005... If you have done that, I am sure, you will get that option...
Now if you dont want to use codefile (It may have been produced while you add in your project), you can just omit the options
CodeBehind="yourfile.aspx.cs" Inherits="yourclass" of the Page Tag of aspx.
And if still its not creating inline server side script in aspx, you have to manually add the script tag with runat = server and write your C# code there..
I am sorry for not understanding you properly ... hope this works to you.
Abhishek Sur
|
|
|
|