|
Hi kissy,
You just send me that code.
Thanks & regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
Dim ds As New DataSet
sedr = New SqlDataAdapter("Select * from Offices", dbconn)
sedr.Fill(ds, "Offices")
Dim dr As DataRow
For Each dr In ds.Tables("Offices").Rows
//For i = 0 To ds.Tables("Offices").Rows.Count - 1
dr = ds.Tables("Offices").Rows(i)
If TxtOff.Text = dr.Item("office_id").ToString() Then
i = i + 1
TxtOff.Text = dr.Item("Office_id").ToString()
End If
Next
just check it,how to maintain,viewstate??/
kissy
|
|
|
|
|
hi kissy,
if you declare a variable in asp.net,it will lose its value after postback.
for eg:
dim i as integer=1
and in the click event if you type
i=i+1 'then i(variable) will store now 2
and if you try to click the button it will always show you 2. Since it does not support viewstate. So i suggest you to store this value in one of your web control(i.e label) and hide this control if you dont want to show its value to end user.
Thanks & regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
Hai
I have given u a mail with my problem,otherwise read this.
urs answer is working for Button_next.
But the same code with some changes is not working for the Prev_button.Label value is working for the next record only,this is not global,and we are using in the event handler.so the same label should work for the button_Prev,bcz we need to navigate from the present record to prev or next.hope u might have got wat i am trying.
Give me an idea
thank you for ur patience.i am new to this asp.net
kissy
|
|
|
|
|
Hi kissy,
You have to use the same label for storing the value.If you click on the next button, its value(i.e your label value) should get incremented by 1 and if you click on the previous button, its value should get decremented by 1.
Thanks & regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
Thank you so much,My problem solved,Thanks for ur help and respond me whenever i have a doubt
kissy
|
|
|
|
|
Always welcome.............
Thanks & regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
Test......
Everything Is Possible!
|
|
|
|
|
I am working on an e-commerce site.Please tell me how to use SSL certificate for my site.I have the certificate but dont know how to use it in my application.(Its an ASP.NET (C#) web application)
Priyam Malhotra
|
|
|
|
|
I have a small application which has Textarea control,textbox control,and a button control.I have some text in the Textarea control.when i select some part of the text in the Textarea control and pressed a button,that selected text along with the starting index and ending index should be displayed in the textbox.i have achieved of capturing the selected text into the textbox but i couldn't able to trace starting and ending index of selected text.
can you plz help me out.....
Thanks
bye
kamalnath
|
|
|
|
|
I have a problem to post any file in XAML(WinFX).I have code to post file in asp.net 2.0.But I want to implement it also in WinFX.Any body know how to do that?
|
|
|
|
|
I want to make a control in WinFX that save any file to perticular location in local system.Can anyone help me?
|
|
|
|
|
Hi
I am developing an asp.net site with 5 layers as UI, DAO, DTO, Business and DAL. I am confused where should i do exception handling. Do i need to do it on each tier code or just i do it on UI layer.....Please suggest.
I am planning to use resource file and log4net. And for all layers except UI, i am planning to maintain trace on log file and on the other hand for UI i will display error on custom error.aspx page and as well as on log file.....
Am i correct, as i am doing n tier application first time. Is there any other simpler and full proof way......PLEASE SUGGEST...
Amit
|
|
|
|
|
Amit Kumar G wrote: Is there any other simpler and full proof way
Yeah, don't run the app, that way you will never get any exceptions
You should handle the exception in the code where it happens. If it is something that can be corrected, then do so, otherwise rethrow it up the call stack. I'm curious as to why you think you need so many layers?
I would suggest using the Enterprise Library Exception Handling Block. It is easy to configure and setup multiple policies for different exceptions and situations.
only two letters away from being an asset
|
|
|
|
|
I agree with you, but to buy bread i have to run the application )
Jokes apart.
I appreciate your reply. Can you help me to understand how i can use enterprise library. I have zero idea for this.
Cheers
Amit
|
|
|
|
|
|
Hi,
you can use microsoft enterprise library for exception handling and database operations. That will log the exception on the event viewer.
Catch the exceptions in all layers, but log the exception only from the UI layer. Throw exceptions from other layers to the UI layer.
Istead of using enterprise library, you can log your events and exceptions with datatime on a text file in a specific directory. Those files can be used to keep track of the execution.
Ram
|
|
|
|
|
I am still having trouble with Form Authentication. Looks like my vb code doens't like the FormsAuthentication.RedirectfromLoginpage. I think its a variable that is not declared.
Here is my web.config
<configuration>
<system.web>
<compilation defaultlanguage="vb" debug="true">
<customerrors mode="RemoteOnly">
<authentication mode="Forms">
<forms name="AuthCookie" loginurl="Login.aspx" defaulturl="Default.aspx"
="" timeout="60" protection="All" cookieless="AutoDetect">
<authorization>
<deny users="?">
<trace enabled="false" requestlimit="10" pageoutput="false" tracemode="SortByTime" localonly="true">
<sessionstate
="" mode="InProc" stateconnectionstring="tcpip=127.0.0.1:42424" sqlconnectionstring="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20">
<globalization requestencoding="utf-8" responseencoding="utf-8">
This is what my login button looks like:
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Dim objSqlDataset As New DataSet
Dim isfound As Boolean = False
Dim objSqlDataAdapter As New SqlDataAdapter
Dim i As Integer = 0
Dim SelectMembers = New SqlCommand("select * from Members", objSqlConnection)
objSqlDataAdapter.SelectCommand = SelectMembers
objSqlDataAdapter.Fill(objSqlDataSet, "Members")
pstrUserId = Me.txtUserId.Text.Trim
PstrPassword = Me.txtPassword.Text.Trim
With objSqlDataSet.Tables("Members").TableName
Do Until (i >= objSqlDataSet.Tables("Members").Rows.Count Or isfound)
If objSqlDataSet.Tables("Members").Rows(i).Item("UserId").TOUPPER = pstrUserId.ToUpper Then
'Update the Flag
isfound = True
Else
'increment the counter
i = i + 1
End If
Loop
If isfound Then
If objSqlDataSet.Tables("Members").Rows(i).Item("Password").TOUPPER = PstrPassword.ToUpper Then
If Me.chkPassword.Checked = True Then
Response.Cookies("FremontPokerLeague")("FirstName") = objSqlDataset.Tables("Members").Rows(i).Item("FirstName").trim
Response.Cookies("FremontPokerLeague")("userId") = Me.txtUserId.Text.Trim
Response.Cookies("FremontPokerLeague")("Password") = Me.txtPassword.Text.Trim
Response.Cookies("FremontPokerLeague").Expires = DateTime.Now.AddMonths(1)
formsauthentication.redirectfromloginpage(pstrUserId, False)
End If
objSqlDataset.Dispose()
objSqlDataset = Nothing
objSqlDataAdapter.Dispose()
objSqlDataAdapter = Nothing
insertLogin()
Else
Lblstatus.Text = "Invalid Password!"
End If
Else
Lblstatus.Text = "Invalid User Id!"
End If
End With
End Sub
|
|
|
|
|
Hi All,
I have Gridview and inside checkbox/Dropdownlist controls.I want capture checked/selecteditem rows values.
I am trying to get select checkbox rows values.but IsChecked variable not set True.Here is the example code.
// Checkbox control...
Dim i As Integer
For i = 0 To gridview1.Rows.Count - 1
Dim gvr As GridViewRow = gridview1.Rows(i)
Dim isChecked As Boolean
isChecked = CType(gvr.FindControl("checkbox1"),CheckBox).Checked
If isChecked Then
textbox1.Text = gridview1.Rows(i).Cells(1).Text
End If
Next
// DropdownList
Dim gvr As GridViewRow
Dim str As String
For Each gvr In gridview1.Rows
str = (CType(gvr.FindControl("ddlType"), DropDownList)).SelectedItem.Text
textbox2.Text = str
Next
Please let me know why is not working the above code and how to do that.
Thanks & Regards
Rao
|
|
|
|
|
hi, i have this follow code.
this method of de web service class:
[WebMethod]
[BugTracker.ExtenxionSoap]
public Bug GetBug(int intid)
{
Bug ob = new Bug();
//ob.bug(intid);
return ob;
}
And other class when call the attribute:
[AttributeUsage(AttributeTargets.Method)]
public class MostrarSoapi: SoapExtensionAttribute
{
private int priority;
public override System.Type ExtensionType
{
get { return typeof(BugTracker.ExtenxionSoap); }
}
public override int Priority
{
//get { return priority; }
get { return 1; }
set { priority = value; }
}
}
finally the class de soapextension inherints:
public class ExtenxionSoap: SoapExtension
{
/* here i have all methods inherints
the error is following:
c:\inetpub\wwwroot\BugTracker\Bugs.asmx.cs(53): The type or namespace name 'ExtenxionSoap' does not exist in the class or namespace 'BugTracker' (are you missing an assembly reference?)
why:
[WebMethod]
[BugTracker.ExtenxionSoap]
[AttributeUsage(AttributeTargets.Method)]
public class MostrarSoapi: SoapExtensionAttribute
{
private int priority;
public override System.Type ExtensionType
{
get { return typeof(BugTracker.ExtenxionSoap); }
}
public override int Priority
{
//get { return priority; }
get { return 1; }
set { priority = value; }
}
}
thanks and excuseme for my englihs.
|
|
|
|
|
Hello,
my current situation is this. I have an invoice that is created dynamicly using asp.net. I need to print out the invoice, however IE default margin settings screw it all up. I know that you can change the settings on the browser, but we are a small/medium sized company and have hundreds of users using the application. And as we all know, End Users cant do anything right, so having them change the settings on their computers is out.
What i think i need to do is convert the page to a PDF that way my margin get set (programmatically). Now i have found TONS of programs and 3rd party sources that can convert to a PDF on the fly... here is the catch! I need to be able to print on the fly. I dont want to save the PDF anywhere on any hard drive, i want the user to click on "Invoice" and it converts the page and then prompts them with a print window.
Has anyone else had to do something similar or know of a product that can do what i am looking for?
Steve-o H.
There are 10 kinds of people in this world... Those who understand binary and those who dont.
|
|
|
|
|
Hi,
I have some static content on my page like logo and menu ,
the problem is that when the page loads all the things comes part by part.
What i want to do is to show the logo and the menu first and then meanwhile buffer the other contents and then display it.
And also how to buffer different parts of page.
And also how to cache the image in client side.
Thanks in advance.
Deepak Surana
|
|
|
|
|
You can hide elements while they are loading, and in the onload event of the page show them.
There is no such event for a part of a page, though. You would have to monitor the load status of each element of that part to determine when it's loaded.
Caching of images is done by the browser, and there is hardly any need to do any additional caching. Also, there is no way that you can store that kind of data from page to page, so to do any form of caching yourself, you would have to use something like a hidden frame.
---
b { font-weight: normal; }
|
|
|
|
|
Hiding will not solve the problem, i want to increase the performance of the page.
|
|
|
|
|
To improve performance in my apps I utilized Elvin Cheng's ViewState Provider article. See here
|
|
|
|