|
Hello,
I have to open a popup and pass values from controller in UIPAB. Any idea how to open an popup without navigating to any view from the caller screen?
I appreciate any help
- ashish
|
|
|
|
|
Hi,
i've got a datasource ie "employees" with columns id, name, surname.
I'm binding to a gridview, but display only name, surname but i'v added a select column. How do I get the ID VALUE for the selected row, when i click on select hyperlink in the select column.
thx
Regards,
Tintin
|
|
|
|
|
Get it from the DataKeys collection for the selected row like this?
Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting
Try
Dim iInt As Integer = CType(GridView1.DataKeys(e.RowIndex).Value, Integer)
' Do stuff here
Catch ex As Exception
LogException(ex)
End Try
End Sub
|
|
|
|
|
I am trying to write an application in ASP.NET with c sharp that would prompt the user for a drive letter, computer name and share name (i.e. f:\\192.168.0.100\myShareFolder) and after the client enters this information the application will automatically map a network drive on the client’s computer.
I found an example in C sharp (http://www.codeproject.com/csharp/mapnetdrive.asp)that would do this operation however when I implemented it in ASP.NET it only worked on the server computer.
Please help!
Thanks
chhabrni
|
|
|
|
|
chhabrni wrote: however when I implemented it in ASP.NET it only worked on the server computer.
This is because it is server side code. You can't alter the client's hard drive. I don't believe that this is possible via client side script either, due to the security issue it would pose.
|
|
|
|
|
Thanks for the response.
In that case, is there any way I can run an application (exe) on the client's computer? (i.e. open notepad on client's computer after clicking a button on the aspx web page). Maybe there is a function that the client has to authorize so that the application can run on the client’s computer?
I appreciate the help.
|
|
|
|
|
In my MasterPage I have this code:
private string _callbackResult = null;
protected void Page_Load(object sender, EventArgs e)
{
string cbReference = Page.ClientScript.GetCallbackEventReference(this, "arg", "Result1", "context");
string cbScript = "function UseCallback1(arg, context)" + "{" + cbReference + ";" + "}";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "UseCallback1", cbScript, true);
}
public void RaiseCallbackEvent(string eventArg)
{
string res = AgentLogin(eventArg).ToString();
_callbackResult = res;
}
public string GetCallbackResult()
{
return _callbackResult;
}
When I open the first page - everything is ok! But when I move to the second page I can see that there is no "UseCallback1" JavaScript function in HTML!
Help me please to fix this problem!
|
|
|
|
|
A simple check is that the web page 2 uses the master page?
|
|
|
|
|
hi,
I have a user control with one textbox(ie a javascript calender). I want to access the value of text box by javascript
User control name: Cal1
textbox ID=txt_Date
By Binu Varghese
|
|
|
|
|
You will need to output the client id of the control (i.e. txt_date.clientID) to the page as a javascript variable. The client id depends on the nesting of the user control in other server controls on the page.
|
|
|
|
|
i didn't get you, how to output the clientID of the text box. Can u help me to solve the problem.?
|
|
|
|
|
Either put it in the mark up as an attribute on the text box, or assign it in the code behind : tbYourTextBox.ClientID.
|
|
|
|
|
aspx.vb file
Public Class Default1<br />
Inherits System.Web.UI.Page<br />
<br />
Dim inc As Integer<br />
Dim txtEventDate As Date<br />
Dim txtEventTrigger As Date<br />
<br />
Dim objConn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _<br />
"Data Source= " & Server.MapPath("~/App_Data/db1.mdb"))<br />
<br />
Public Sub LoadData()<br />
Dim da As New OleDbDataAdapter("SELECT * FROM checklist_Items", objConn)<br />
Dim ds As DataSet = New DataSet()<br />
da.Fill(ds, "checklist_Items")<br />
<br />
MyDataList.DataSource = ds.Tables("checklist_Items").DefaultView<br />
MyDataList.DataBind()<br />
<br />
End Sub<br />
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br />
If Not IsPostBack Then<br />
LoadData()<br />
End If<br />
<br />
End Sub<br />
Sub Update_dc(ByVal ID)<br />
<br />
'---updates the database---<br />
Dim sql As String = "UPDATE checklist_Items SET date_Completed=#" + txtEventDate + "# WHERE ID=" + ID<br />
Dim comm As New OleDbCommand(sql, objConn)<br />
<br />
objConn.Open()<br />
comm.ExecuteNonQuery()<br />
objConn.Close()<br />
<br />
MyDataList.EditItemIndex = -1<br />
LoadData()<br />
<br />
End Sub<br />
<br />
Sub Update_dt(ByVal ID)<br />
<br />
'---updates the database---<br />
Dim sql As String = "UPDATE checklist_Items SET date_Trigger=#" + txtEventTrigger + "# WHERE ID=" + ID<br />
Dim comm As New OleDbCommand(sql, objConn)<br />
<br />
objConn.Open()<br />
comm.ExecuteNonQuery()<br />
objConn.Close()<br />
<br />
MyDataList.EditItemIndex = -1<br />
LoadData()<br />
<br />
End Sub<br />
Sub MyDataList_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles MyDataList.UpdateCommand<br />
Dim tbox As TextBox<br />
Dim ID0 As String<br />
Dim sday As DateTime<br />
<br />
'---retrieves the key for the row---<br />
ID0 = MyDataList.DataKeys(e.Item.ItemIndex)<br />
<br />
'---find the textbox control containing the dateCompleted<br />
tbox = CType(e.Item.FindControl("txtEventDate"), TextBox)<br />
txtEventDate = tbox.Text<br />
sday = txtEventDate<br />
If (ID0 = 5) Then<br />
Update_dc(ID0)<br />
MsgBox("eventdate " + txtEventDate)<br />
'---retrieves from another database---<br />
Dim con = "Provider=Microsoft.Jet.OLEDB.4.0;" & _<br />
"Data Source= " & Server.MapPath("~/App_Data/vcalendar.mdb")<br />
Dim da As OleDbDataAdapter<br />
Dim dc As New DataSet<br />
<br />
'Dim con As New OleDb.OleDbConnection<br />
Dim cn As OleDbConnection = New OleDbConnection(con)<br />
cn.Open()<br />
Dim c As String = "SELECT * FROM events"<br />
<br />
da = New OleDb.OleDbDataAdapter(c, cn)<br />
da.Fill(dc, "events")<br />
cn.Close()<br />
<br />
'---find the textbox control containing the dateTrigger<br />
Dim tbox1 = CType(e.Item.FindControl("txtEventTrigger"), TextBox)<br />
txtEventTrigger = tbox1.text<br />
tbox1.Text = dc.Tables("events").Rows(inc).Item(26)<br />
<br />
Dim objdate As DateTime = New DateTime(Year(tbox1.Text), Month(tbox1.Text), Day(tbox1.Text))<br />
Dim sday1 As DateTime = objdate<br />
sday1 = sday1.AddDays(5)<br />
txtEventTrigger = sday1<br />
<br />
Update_dt(ID0)<br />
<br />
<br />
End If<br />
<br />
End Sub
i'm trying to update into database A this row and cell(date_Completed) with the value i typed into the textbox but at the same time, when i clicked on update, it should update the above statement as well as retrieve from another database B's table value and add 5 days. Upon addition, it should update the calculated value into the database A's same row and cell(date_Trigger).
But i'm facing this problem now that when i click on update, it will update the retrieved date from database B into database A's cell(date_Completed) and update the calculated value into database A's cell(date_Trigger). It kind of overwrites the value i typed in the textbox that was supposed to be updated and stay in the database A's cell(date_Completed).
I hope someone out there is able to understand my codes and provide me further help into this. Btw, if you think you needed more details into the .aspx file, please let me know. Thanks.
frossie
|
|
|
|
|
Response.Redirect("ProductListing.aspx?BrandID="+DropDownList1.SelectedValue+"&CatID="+DropDownList2.SelectedValue);
can anyone explain wat this code is for?
i am currently trying to understand an sample project
this code is found inside an button which suppos to query the 2 listbox
however everytime i click it the queary on the dropdownlist2 is set back to all instead of the one i choice.
some other question:
pls correct me if i am wrong
pageload is an function activated when a button is pressed rite?
is there any function that is for when the page is load at first(meaning run once only)
|
|
|
|
|
neodeaths wrote: can anyone explain wat this code is for?
The code constructs an url and sends as a redirect page to the browser. The browser will then request that page from the server.
however everytime i click it the queary on the dropdownlist2 is set back to all instead of the one i choice.
Then the code that examines the query string and selects the proper item is faulty.
pageload is an function activated when a button is pressed rite?
is there any function that is for when the page is load at first(meaning run once only)
The Page_Load method is called every time the page is created.
You can use the IsPostBack property to find out if the request comes from a postback or not.
Note: If you use a redirect the IsPostBack property will be false, as the request doesn't come directly from a postback.
---
b { font-weight: normal; }
|
|
|
|
|
thx i am now beginning to understand your ans was clean and clear thx u veri much
|
|
|
|
|
I was asked recently if I can create an ASP.NET application that among other things -can print data into specified fields on a "pre-printed" letter sized form.
My first impulse was to recreate a web page similar to the required form, have it filled out from the relevant datasource and just print the web page. Unfortunately this idea was scrapped because the application would have to use an existing stock of "official" blank forms.
As a newcomer to ASP.net I am not sure how best to approach this so my questions are-
*How should this be done?
*Is there some off the shelf control that can be used to accomplish this.
(give me the url if possible)
Thanks in advance.
simple one
|
|
|
|
|
You should probably consider whats known as a print style sheet:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dynstyle/printing.asp
|
|
|
|
|
Hi,
how do i retrieve the original source code of an asp file?
Thanks
Ashok
|
|
|
|
|
I'm not sure what you might want to do. Could you be more specific about your context?
|
|
|
|
|
'Menu' control has a property called TARGET. It may have 5 special values (starting with "_", eg."_blank"), or a custrom string, which is a name of the place, where pages should be loaded. I know its all in theory, but I couldn`t manage to force 'Menu' control to "put" selected pages into placed I wanted them. Could someone give me an example?
Suppose we have a masterpage with 2 placeholders, and I would like to load selected pages into first of them.
thank you very much for help
|
|
|
|
|
These two things are different, the Target property allows you to specify the window/frame to display the output html markup of the web page. The placeholder control in the master page is to reserve a place that you can provide dynamic contents in the content page. So if you have two placeholders in the master page and you only want to provide the content in the first one, then in the content page you can use a single content control to work with the first placeholder control.
|
|
|
|
|
Hi All,
I am using ASP.net 2.0 and I need to use the System.Windows.Forms.FolderBrowserDialog, so web users can select a directory on their local pc. to achive this I have created a simple windows control that had one button and opens
up FolderBrowserdialog box.
here is the coder for it
"using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Security;
using System.Security.Permissions;
namespace DirectoryViewer
{
public interface intDirGet
{
string DirLocation { get;set; }
}
public partial class UserControl1 : UserControl,intDirGet
{
string _DirectoryLocation;
public string DirLocation { get { return _DirectoryLocation; }
set {_DirectoryLocation=value;
this.txtDirLocation.Text= value;}
}
public UserControl1()
{
InitializeComponent();
}
private void btnShowDirectory_Click(object sender, EventArgs e)
{
if(fbd.ShowDialog() == DialogResult.OK)
{
DirLocation = fbd.SelectedPath.ToString();
}
}
}
}
"
I have added the dll generated by this custom user control from (...\controllib\bin\debug\)to root directory of the my asp.net page
<object id="DirectoryViewer" classid="http:DirectoryViewer.dll#DirectoryViewer.UserControl1" />
When I try to run this app using the debugger or even when I relase it, I get the following error.
"System.Security.SecurityException: Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed."
I have tried to change my IIS settingto Windows Authantication and I
have add <identity impersonate="true"/>
Do I need to do anything with the WindowsControl.dll? or what can I do
to get around this problem.
Thanks Leyla
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Security.SecurityException: Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand,
StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Windows.Forms.FolderBrowserDialog.get_SelectedPath()
at ShowDirectoryButton.UserControl1.btnShowDir_Click(Object sender,
EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission
The Zone of the assembly that failed was:
Intranet
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
ShowDirectoryButton
Assembly Version: 1.0.2414.26587
Win32 Version: n/a
CodeBase: http://localhost:4496/ShowDirectoryButton.DLL
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Microsoft.mshtml
Assembly Version: 7.0.3300.0
Win32 Version: 7.0.3300.0
CodeBase:
file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
|
|
|
|
|
|
Hi All,
I am in a need where I have to develop a new control,
which should act as HTML FILE CONTROL, but it should browse server machine's folders. The path I selected need to be stored in db.
The hardle here is .. to browse server's file system.
I only know System.IO can help a bit, but not sure how far it is helpful.
Please guide me in this regard..
1. Any existing control solves my problem.
2. Do I need to develop a screen using System.IO name space..
Please let me know if any other alternate can make my way clear.
Thanks in advace..
Chinna
|
|
|
|