|
The sample code simply looks like this:
Text='<%# "LoginName: " + UserLoginName %>'
|
|
|
|
|
LOL.
I didn't think of that.
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Right I have a flash interface, and I need to pass a variable from flash to asp.net in order to set a variable that is important to the running of my web page.
here is my action script
******************************************
btn_1.onRelease = function(){
PosId = "First";
getURL("WebForm2.aspx", "_self", "POST");
};
******************************************
Now I need to know how to retieve that vaiable in asp.net.
I have tried using,
Dim Pos As String
Pos = Request.QueryString("PosId")
But this doesn't work, any help would be appreciated.
|
|
|
|
|
Well you specify the POST protocol in the GetURL, so it would be
Request.Form["PosId"]
or specify GET in the getURL line and your code should work.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
I am facing a big problem in using datagrid.. while designing datagrid i dont know no of columns and no of rows.. So I am creating datacolums on the basis of a the resultset returned by the query at runtme. My problem is I am populating resultset into DATA Table then binding it to datagrid, Now I want the last column to be of type Combo Box, which is extra column and is not returned by the query.
Kindly let me know whther i can create addtional column in such a way at runtime
|
|
|
|
|
Basically, you can dynamically create the last column containing the DropDownList/ListBox control, then add it to the Columns collection of the datagrid control. To create the custom column, you have two options:
+ You can create a custom template column which implements the ITemplate interface, you can see more info from the article[^]. The downside of this way is that you cannot handle the postback event of the dropdownlis/listbox control if you want to do that.
+ Another option is that your custom control can inherit from the DataGridColumn class, and override the InitializeCell method to add the dropdownlist/listbox control to the table cell.
|
|
|
|
|
when i try to upload the file it gives error "Access denied".
then it gives me solution to change the rights of folder going into the security tab.
when i goto the property of project it shows me only four tab.....
General -- Sharing --WebSharing---Customize.
no security Tab.
what should i do to resolve this Error.
|
|
|
|
|
The error is suggesting that your ASP.NET application does not have priveledges to write to the upload folder - you indicate that you were looking at the "property of project" - did you mean the properties of the upload folder?
What operating system are you running? Are you using NTFS for the file system?
|
|
|
|
|
|
Vasudevan Deepak Kumar wrote: For your problem, you can open inetmgr. Navigate to the virtual directory, RightClick properties and give 'Write' Access from there. That alone should work.
Ouch. You just gave the entire world write permission to the folder.
If the file system is not NTFS, it is not a permission problem. A FAT disk has no permission system at all.
---
b { font-weight: normal; }
|
|
|
|
|
Also, you might want to check this condition: if your machine (XP) is not joined to a domain, then you don't see the Security tab by default. If this is the case, you can display this tab as below:
+ Go to the Folder Options dialog (you can see this in Control Panel, or in the Tools menu of the Window Explorer).
+ In the View tab, under the Advanced Settings, uncheck the "Use simple file sharing (Recommended)" option.
|
|
|
|
|
hai every one
i m ajay
facing a problem related to modal dialog boxes
i have one page on which i have taken two list boxes.i m populating the first list box frm database.ther r 2 buttons add and remove.u can add items in the second list box and vice versa.
working fine for me
problem arises when i m opening this page as a modal dialog box frm anothr page.
when i m selecting a value frm first list box and click on the add button in dialog box it opens a new instance of the same page and allow me to add.
i did not want this behaviour.i just want to do all operations in the same dialog box .
plz help
any suggetion will be highly appriciated.
ajay
coding of the page frm where i m opening dialog box(containing list boxes)---
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
Dim listitems As String
listitems = Session("listitems")
'Response.Write(listitems)
Label2.Text = listitems
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Session("temp") = TextBox1.Text
'Response.Redirect("webform2.aspx")
Button1.Attributes.Add("onclick", "window.showModalDialog('webform2.aspx', null,'status:no;dialogWidth:370px;dialogHeight:220px;dialogHide:true;help:no;scroll:no');")
End Sub
End Class
coding of webform2------
Imports System.Data.SqlClient
Public Class WebForm2
Inherits System.Web.UI.Page
Dim str1 As String
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents lstbox1 As System.Web.UI.WebControls.ListBox
Protected WithEvents lstbox2 As System.Web.UI.WebControls.ListBox
Protected WithEvents btnsubmit As System.Web.UI.WebControls.Button
Protected WithEvents btnremove As System.Web.UI.WebControls.Button
Protected WithEvents BtnBack As System.Web.UI.WebControls.Button
Protected WithEvents hdFieldNames As System.Web.UI.HtmlControls.HtmlInputHidden
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not Page.IsPostBack Then
'Dim sql_conn As New SqlConnection("server=mms-server2;uid=sa;pwd=miqaat098;database=bank_1.1")
Dim sql_conn As New SqlConnection("server=mms-server2;uid=sa;pwd=miqaat098;database=safe")
Dim str As String
Dim zRow As DataRow
sql_conn.Open()
Dim dset As New DataSet
Dim temp As String
temp = Session("temp")
Dim sql_cmd As New SqlCommand("select * from mms_dataitem_master", sql_conn)
' Dim sql_cmd As New SqlCommand("getfieldvalues", sql_conn)
' sql_cmd.CommandType = CommandType.StoredProcedure
'sql_cmd.Parameters.Add("@DataItemName", temp)
Dim sadapter As New SqlDataAdapter(sql_cmd)
' Dim sadapter As New SqlDataAdapter
' sadapter.SelectCommand = sql_cmd
sadapter.Fill(dset)
lstbox1.Items.Clear()
lstbox1.DataSource = dset
'For i = 0 To dset.Tables(0).Rows.Count
If lstbox1.Items.Count < 1 Then
For Each zRow In dset.Tables(0).Rows
'ListBox1.Items.Add(dset.Tables(0).DefaultView(0).Row.Item("name"))
lstbox1.Items.Add(zRow.Item(temp))
Next
End If
sql_conn.Close()
End If
End Sub
Private Sub btnsubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsubmit.Click
If lstbox1.SelectedIndex < 0 Then
Me.btnsubmit.Attributes.Add("onclick", "return confirm('Are you sure you want to delete?');")
Else
Dim Item As ListItem = New ListItem
If lstbox1.SelectedIndex > -1 Then
Item.Text = lstbox1.SelectedItem.Value
Item.Value = lstbox1.SelectedItem.Text
lstbox1.Items.Remove(lstbox1.SelectedItem)
lstbox2.Items.Add(Item)
'concatinates the second list box values in a hidden texbox hdFieldNames
hdFieldNames.Value = hdFieldNames.Value & Item.Text & ","
End If
End If
End Sub
Private Sub btnremove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnremove.Click
If lstbox2.SelectedIndex < 0 Then
Me.btnremove.Attributes.Add("onclick", "return confirm('Second ListBox Is Empty.Click On The Add Button To Insert an Item In The List');")
Else
Dim Item1 As ListItem = New ListItem
If lstbox2.SelectedIndex > -1 Then
Item1.Text = lstbox2.SelectedItem.Value
Item1.Value = lstbox2.SelectedItem.Text
lstbox2.Items.Remove(lstbox2.SelectedItem)
lstbox1.Items.Add(Item1)
End If
End If
End Sub
Private Sub BtnBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBack.Click
Session("listitems") = hdFieldNames.Value
Response.Redirect("webform1.aspx")
End Sub
End Class
|
|
|
|
|
Hello,
I have a big problem.I have a page which has html and asp controls on it.COmplete validation is done using javascript.Now I have 2 dropdownlists one for countries and other for states.I should get the states based on the countries.So I have to set the autopostback of countries dropdownlist to true.The button that I have is submit button of html.the problem is how to write the code to update the data on the page.Right now I have the code in page load event.But as autopostback of countries dropdownlsit is true the page gets posted in between.So I cannot have the update code in the pageload.As the controls are html cotrols how do i write events for html.I cannot write javascript to update the database.It is very very urgent for my project.I need it badly.KIndly some one give me a solution for the problem.
|
|
|
|
|
I have no idea what your talking about.
"the problem is how to write the code to update the data on the page"
Cant you put it in the code in the:
Private Sub DropDownList_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList.SelectedIndexChanged
?????
|
|
|
|
|
Change your submit button from an HTML button to an ASP.NET server control <asp:Button runat="server"/> . Create an event handler for its OnClick event and put your update code there.
-- modified at 9:02 Thursday 27th April, 2006
By the way, you might want to refrain from adding things like "It is very very urgent for my project.I need it badly." to your forum posts. That's a good way to get your message ignored.
|
|
|
|
|
Hello Mr.Mike,
As I have clearly mentioned I cannot change html button to asp button.I have javascript validators.Some Conrols are html controls and some are asp controls.For all the HTML controls i am using javascript to validate.Now I have to continue with that form as it is.I cannot change the button to asp button.How to go abt it.Ok clearly speaking I should send all the values in this page to another page on the button click.
Uma
|
|
|
|
|
Uma Kameswari wrote: As I have clearly mentioned I cannot change html button to asp button
I see no mention in your original post that you "cannot change html button to asp button". There was nothing in your original post that "clearly" indicated anything of the sort.
Uma Kameswari wrote: I have javascript validators
No problem. Lots of ASP.NET pages use custom client side javascript for validation. You can use the OnClientClick property of the <asp:Button /> to run your javascript validation.
My original suggestion stands. In my opinion, your best course of action is to code an event handler for the Click event of your submit button (making it an <asp:Button /> ) and perform your database update in that code.
|
|
|
|
|
ok Mr.Mike I will check it tomorrow .
|
|
|
|
|
Hello Mr.Mike,
Can u tell me how to use the onClientClick property of <asp:button>
|
|
|
|
|
Sure - it's an ASP.NET 2.0 property, and you simply assign the javascript you want rendered as part of the client-side onclick javascript event.
The MSDN documentation for OnClientClick[^] has a good example.
|
|
|
|
|
I am developing an application on my local machine in the office in asp.net 2.0 to send emails.
The application is now able to send emails to external and NOT to internal email addresses.
Do you know what is wrong please?
Thanks
|
|
|
|
|
These types of things often turn out to be SMTP configuration. Are you running your own SMTP server? Is someone else responsible for the SMTP server for "internal" email addresses?
|
|
|
|
|
I don't know.
I am running the application (Which I am developing) in my machine.
If the site is sending emails externally the why it does not send emails to anyone internally?
Thanks
|
|
|
|
|
fmardani wrote: I don't know.
You have to know what SMTP server you are using.
fmardani wrote: If the site is sending emails externally the why it does not send emails to anyone internally?
System administrators can establish different rules for different SMTP servers. It may be that your organization's email server has restrictions on who is allowed to use it as a relay. You need to check with your SMTP system administrator(s).
|
|
|
|
|
Hello Friends,
How to fire RowCancelingEdit of gridview programmatically. Actually i have implemented Atlas AJAX of Microsoft, and after clicking inbuilt update button of the GridView record is updated but Grid remains in edit mode. Then i have to presss Cancel button to bring it to normal mode. Any solutions to this problem guys..
thanks in advance
Sheel Gohe
|
|
|
|