|
I am working with asp.net using c# the webapplication running on localserver when i want to run webapplication in remote machine the following error shown
Cannot show a file dialog unless the application is running in UserInteractive mode
Cannot show a file dialog unless the application is running in UserInteractive mode.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Cannot show a file dialog unless the application is running in UserInteractive mode.
Source Error:
Line 166: string FileName, FilePath;
Line 167: int j = ListBox1.Items.Count;
Line 168: OFD.ShowDialog();
Line 169:
Line 170: FileName = OFD.SafeFileName;
Source File: e:\siva\kumar\aspmerger\Default.aspx.cs Line: 168
Stack Trace:
[InvalidOperationException: Cannot show a file dialog unless the application is running in UserInteractive mode.]
Microsoft.Win32.CommonDialog.ShowDialog() +4031259
_Default.AddFile() in e:\siva\kumar\aspmerger\Default.aspx.cs:168
_Default.AddTextFile() in e:\siva\kumar\aspmerger\Default.aspx.cs:88
_Default.Add_Click(Object sender, EventArgs e) in e:\siva\kumar\aspmerger\Default.aspx.cs:205
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
|
|
|
|
|
The error means what it says. And what it means is that you have zero idea about ASP.NET. If you knew anything at all, you'd know that server code runs on the server, and client code, on the client. Therefore, your code, if the framework let it run, would cause a message box to show on the server, thus freezing the server, and the client would see nothing, the website would time out.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
hi
i m new to asp.net
i m poulating a menu item on my page load
my menu hav submenus.i hav set the staticdisplaylevel=1
but still it is showing all the levels
when i m doing it on aspx page then this property is working fine
|
|
|
|
|
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
con = New SqlConnection(ConfigurationManager.ConnectionStrings("ESCConnection").ConnectionString)
If IsPostBack = False Then
gridbind()
End If
'for setting language preference
If Request.Cookies("lang").Value Is Nothing Then------>(Object reference not set to an instance of an object wen the cookie has no value)
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
'get the culture info to set the language
rm = New ResourceManager("Resources.Strings", System.Reflection.Assembly.Load("App_GlobalResources"))
ci = Thread.CurrentThread.CurrentCulture
LoadStrings(ci)
End If
|
|
|
|
|
before retrieving the value from cookie check if ur cookie is not null
|
|
|
|
|
anbusenthil wrote: If Request.Cookies("lang").Value
Check first if the cookie Is Nothing.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi I want to make slideshow of four images. The javascript for slideshow is
<br />
<script language="JavaScript" type="text/javascript"><br />
<br />
var slideShowSpeed = 5000; <br />
var crossFadeDuration = 3;<br />
<br />
var Pic = new Array(); <br />
var PicUrl = new Array(); <br />
<br />
var PicCaption = new Array(); <br />
<br />
Pic[0] = 'images/image1.jpg';<br />
Pic[1] = 'images/image2.jpg';<br />
Pic[2] = 'images/image3.jpg';<br />
Pic[3] = 'images/image4.jpg';<br />
<br />
PicUrl[0] = '#';<br />
PicUrl[1] = '#';<br />
<br />
var PageNav='#';<br />
<br />
<br />
var m_intTimeOut;<br />
var j = 0;<br />
var m_intArrayLen = Pic.length;<br />
<br />
var preLoad = new Array();<br />
for (i = 0; i < m_intArrayLen; i++)<br />
{<br />
preLoad[i] = new Image();<br />
preLoad[i].src = Pic[i]<br />
}<br />
<br />
function runSlideShow(){<br />
if (document.all){<br />
document.images.SlideShow.style.filter="blendTrans(duration=2)";<br />
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";<br />
document.images.SlideShow.filters.blendTrans.Apply(); <br />
}<br />
document.images.SlideShow.src = preLoad[j].src;<br />
PageNav=PicUrl[j];<br />
<br />
if (document.all){<br />
document.images.SlideShow.filters.blendTrans.Play();<br />
}<br />
j = j + 1;<br />
if (j > (m_intArrayLen-1)) j=0<br />
m_intTimeOut = setTimeout('runSlideShow()', slideShowSpeed);<br />
}<br />
<br />
function pg_nav()<br />
{<br />
window.location.href=PageNav;<br />
}<br />
</script><br />
<br />
In the body I have called the runslideshow function.
<br />
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="runSlideShow();"><br />
The images are displayed in the image tag with id=” SlideShow”
<br />
<td><a href="states.aspx?page=1"><br />
<br />
<img src="images/image1.jpg" name="SlideShow" id="SlideShow" width="579" height="145" border="0" alt=""/></a></td><br />
<br />
This code is running fine in internet explporer but not working in firfox.
Please help me.
|
|
|
|
|
Install firebug and debug the JS. That is the way to go.
|
|
|
|
|
Hi Navaneeth ,
Thanks for giving this idea. i have installed the debugger bt im unable to debug my javascript. My javascript is on the aspx page and is called on body's onload event.
How ill debug it.
|
|
|
|
|
It's incredibly easy, and there are pages explaining how to use firebug. Of COURSE the JS is in your aspx page. You set a breakpoint, refresh the page, and it will stop and you can step through.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
setTimeout
filters function is not supple
living none stoping.
|
|
|
|
|
Hi, I have a treeview control.On Page Load I am populating this Treeview through code.
The TreeView contains one parent node and this parent node contains several child nodes.
My problem is that on Treeview_SelectedNodeChanged event Whenever I am selecting a child node,it automatically selects the first child node only.
I am after this for last 2 days.I have worked with TreeView several times, but never faced such problem.
Please Help.
ARINDAM
|
|
|
|
|
Hi Arindam
I am not getting where the problem is because its working fine when i try to replicate your problem in my end.
Can you post your code?
himanshu
|
|
|
|
|
Hi everybody,
My requirement is i have two panels in which having records in repeaters or labels i want to move record from one panel to another like moving records from one list box to another is there any control to perform this task?
Thanks.
|
|
|
|
|
Not built in, no. A panel is just a div, it doesn't actually mean anything, in HTML, apart from a place holder. You're going to have to write javascript to do this. I'm not sure how much viewstate is going to help with postback recording what you've done, either.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi All,
Here is my requirement,
I am developing a web site where a consumer can see his water bills online. page contain Bill's image in the background say bill.aspx.
on that image I am showing his related data from database.
when user click on button (say show my bill) bill.aspx is shown. when bill.aspx is shown a problem arises, that data from sql is shown first, and then image of the bill is loaded, which looks odd. so my client wants to show this page as pdf in browser. as i dont have pdf files , all my record is fetching from database dynemically. please guid me to show my bill.aspx page as pdf in browser.
regards .
muhammad kashif butt
|
|
|
|
|
You will need to buy a library that generates PDFs, then write those down to the browser.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
well any idea towards this technique?
muhammad kashif butt
|
|
|
|
|
Hi All,
I need to split a line like this
1 100224 KBD PS-2 104KEYS TVSE GOLD WHITE 6600 9213549 Indian Core Team
I am using split function to split these words.the splitting is not working proper.I am adding these string in to quick watch some square is displaying between the words. i need to split the word with the square displaying.Plse help me.
Shiji
|
|
|
|
|
This is the third time you are asking the same question !!
shijivijayan wrote: the splitting is not working proper.
What do you mean by not working proper?
|
|
|
|
|
shijivijayan wrote: .the splitting is not working proper
Yes, it is. It will split based on whatever character you give it. The square means there's a control character in your strings, instead of a space.
If this is homework, you should talk to your teacher. If it's paid work, you should be bloody ashamed of yourself. We are happy to help people, but for someone of this skill level to charge for their 'efforts', is a disgrace.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
HI All.
I have Designed a Templated Gridview. and Binds it for the first page load with a predefined DataTable Object which contains some columns.
Now I want to add a new row each time when i click on Add button, while adding new row, the previous state of GridView should not be changed.
what do i do?
|
|
|
|
|
Just follow the following code :
private DataTable GetData(int count)
{
DataTable dt = new DataTable();
dt.Columns.Add("col1");
dt.Columns.Add("col2");
dt.Columns.Add("col3");
DataRow dr=null;
for (int i = 0; i <= count; i++)
{
dr = dt.NewRow();
dr["col1"] = "";
dr["col2"] = "";
dr["col3"] = "";
dt.Rows.Add(dr);
}
return dt;
}
private DataTable GetNewData(int count)
{
DataTable dt = new DataTable();
dt.Columns.Add("col1");
dt.Columns.Add("col2");
dt.Columns.Add("col3");
DataRow dr = null;
for (int i = 0; i < count; i++)
{
dr = dt.NewRow();
dr["col1"] = ((TextBox)grdOrd.Rows[i].Cells[0].FindControl("txtCol1")).Text;
dr["col2"] = ((TextBox)grdOrd.Rows[i].Cells[1].FindControl("txtCol2")).Text;
dr["col3"] = ((TextBox)grdOrd.Rows[i].Cells[5].FindControl("txtCol3")).Text;
dt.Rows.Add(dr);
}
dr = dt.NewRow();
dr["col1"] = "";
dr["col2"] = "";
dr["col3"] = "";
dt.Rows.Add(dr);
return dt;
}
protected void Page_Load(object sender,EventArgs e)
{
if(!IsPostBack)
{
GetData(0);
}
}
protected void btnAddNewRow_Click(object sender,EventArgs e)
{
GridView1.DataSource = GetNewData(grdOrd.Rows.Count);
GridView1.DataBind();
}
<asp:GridView runat="server" id="GridView1" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField HeaderText="Col1">
<ItemTemplate>
<asp:TextBox runat="server" id="txtCol1" Text='<%#Eval("col1")%>'></asp:TextBox>
</ItemTemplate>
<FooterTemplate>
<asp:Button runat="server" Id="btnAddNewRow" OnClick="btnAddNewRow_Click"/>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Col2">
<ItemTemplate>
<asp:TextBox runat="server" id="txtCol2" Text='<%#Eval("col2")%></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Col3">
<ItemTemplate>
<asp:TextBox runat="server" id="txtCol3" Text='<%#Eval("col3")%></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
ARINDAM
|
|
|
|
|
hi all,
I am using VS 2005,C# with framework 2.0 and AJAX toolkit. I got a datagridview and already create a CommandField, button type. I would like to display particular row details by modalpopup extender.
Currently i am using code behind (gridview_SelectedIndexChanged to get neccesarry data) and method modalpopupextender.Show() to acheive it,but its is pretty slow when browse via internet (its ok if browse locally). My coding is show like below:
aspx:
<asp:GridView ID="DataGridProduct" runat="server" <code>OnSelectedIndexChanged="DataGridProduct_SelectedIndexChanged"</code> AutoGenerateColumns="False">
<Columns>
<asp:CommandField ButtonType="Image" ShowSelectButton="True" HeaderText="View" />
<asp:BoundField DataField="ProdCode" HeaderText="Code" ReadOnly="True" SortExpression="ProdCode"
</asp:BoundField>
<asp:BoundField DataField="ProdDesc" Visible="False" />
<asp:TemplateField>
<HeaderTemplate>Description</HeaderTemplate>
<ItemTemplate><%# Limit(Eval("ProdDesc"),25)%></ItemTemplate>
</asp:TemplateField>
</Columns>
modalpopup
<cc1:ModalPopupExtender <code>ID="mpeProduct"</code> runat="server" TargetControlID="Button1" PopupControlID="panelProduct" CancelControlID="btnClose" BackgroundCssClass="modalBackground" PopupDragHandleControlID="panelDrag" Drag="true">
</cc1:ModalPopupExtender>
aspx.cs
protected void DataGridProduct_SelectedIndexChanged(object sender, EventArgs e)
{
if (DataGridProduct.SelectedDataKey[4].ToString() == "Horizontal")
{
lblProductCode.Text = DataGridProduct.SelectedDataKey[0].ToString();
lblProductName.Text = DataGridProduct.SelectedDataKey[1].ToString();
txtProductSpec.Text = DataGridProduct.SelectedDataKey[2].ToString();
txtProductDescription.Text = DataGridProduct.SelectedDataKey[3].ToString();
ImgDisplay.ImageUrl = DataGridProduct.SelectedDataKey[5].ToString().Trim();
<code>mpeProduct.Show();</code>
}
}
so,can i use client script to acheive it, get datagridrow's data and display in modalpopup extender?
any advice and tips are welcome,
thanks in advance
regards
cocoonwls
|
|
|
|
|
Is there any way to get a onchange event to the textboxes that are shown when gridview is in edit mode??
thanks
Peterson
|
|
|
|