|
Hi All,
Suppose if i have a dropdown in a view page and if i select any value in the dropdown and the selected value needs to be passed to the different view.
please let me know how is it possible.(with an example)
Thanks in Advance.
|
|
|
|
|
You can use QueryString for this purpose.
Just google it, you will get a lot of examples on how you can use QueryString in MVC.
|
|
|
|
|
Hi,
I am trying to use custom configuration section in my application in the following way. But its giving me the as below, Did I do any mistake. What should I do when I get assembly load error. I have given the path and every thing correct only. What is the vshost.exe.config file.
Any body please help me any sort of help would be greatly appreciated. Thanks in advance.
An error occurred creating the configuration section handler for FamsTechnologyGroup/QUTransUnionSimulator: Could not load file or assembly 'FTG.QUTransUnionDataViewer' or one of its dependencies. The system cannot find the file specified. (C:\DEV\QUTU\Apps\QuarterlyUpdate\Ftg.Systems.QUTransUnionDataViewer\bin\Debug\Ftg.Systems.QUTransUnionDataViewer.vshost.exe.config line 5)
App Config
<configSections>
<sectionGroup name="FamsTechnologyGroup">
<section name="QUTransUnionSimulator"
type="Ftg.Systems.QUTransUnionDataViewer.QUTransUnionSimulatorConfiguration, FTG.QUTransUnionDataViewer"
allowLocation="true"
allowDefinition="Everywhere"/>
</sectionGroup>
</configSections>
<!-- Custom configuration tags -->
<FamsTechnologyGroup>
<QUTransUnionSimulator
InputFileFormat="INPUT"
ISMissing="True"
MissingSSN="555555555, 999999999, 888888888"
ISError="True"
ErrorSSN="000000000, 111111111"
CannedSuccessFilePath="\CannedReports\TU.CANNED.SUCCESS.pgp"
CannedErrorFilePath="\CannedReports\TU.CANNED.ERROR.pgp"
/>
<DataAccess DefaultAuditIdentifier="QUTransUnionSimulator" />
<ExceptionHandling LogName="Application" EventSource="FTG QUTransUnionSimulator" />
<!-- Service startup settings, built into the heartbeat framework -->
<!-- Service scheduling configration, built into the heartbeat framework -->
<ServiceConfiguration>
<Service ServiceType="QUTransUnionSimulator">
<HeartbeatServiceScheduler>
<ProcessingWindows>
<ProcessingWindow>
<Parameters CheckForWorkInterval="00:01:00" Enabled="true" />
</ProcessingWindow>
</ProcessingWindows>
</HeartbeatServiceScheduler>
</Service>
</ServiceConfiguration>
</FamsTechnologyGroup>
And Code that is trying to access the custom configuration section is
QUTransUnionSimulatorConfiguration obj =
(QUTransUnionSimulatorConfiguration)System.Configuration.ConfigurationManager.GetSection(
"FamsTechnologyGroup/QUTransUnionSimulator");
string cannedSuccessFileName = obj.CannedSuccessFilePath;
string cannedErrorFileName = obj.CannedErrorFilePath;
Custom Config Class
[ConfigurationSectionName("FamsTechnologyGroup/QUTransUnionSimulator")]
public class QUTransUnionSimulatorConfiguration : ConfigurationSection
{
public static QUTransUnionSimulatorConfiguration GetConfig()
{
QUTransUnionSimulatorConfiguration config = ConfigurationHelper<QUTransUnionSimulatorConfiguration>.GetConfig();
return config;
}
public QUTransUnionSimulatorConfiguration() { }
private static QUTransUnionSimulatorConfiguration sInstance;
static QUTransUnionSimulatorConfiguration()
{
try
{
sInstance = ConfigurationHelper<QUTransUnionSimulatorConfiguration>.GetConfig();
}
catch (Exception)
{
sInstance = new QUTransUnionSimulatorConfiguration();
}
}
public static QUTransUnionSimulatorConfiguration Instance
{
get { return sInstance; }
}
[ConfigurationProperty("InputFileFormat", DefaultValue = @"INPUT", IsRequired = true)]
public string InputFileFormat
{
get { return (string)this["InputFileFormat"]; }
set { this["InputFileFormat"] = value; }
}
[ConfigurationProperty("ISMissing", DefaultValue = @"True", IsRequired = true)]
public bool IsMissing
{
get { return (bool)this["ISMissing"]; }
set { this["ISMissing"] = value; }
}
[ConfigurationProperty("MissingSSN", DefaultValue = @"555555555", IsRequired = true)]
public string MissingSSN
{
get { return (string)this["MissingSSN"]; }
set { this["MissingSSN"] = value; }
}
[ConfigurationProperty("ISError", DefaultValue = @"True", IsRequired = true)]
public bool ISError
{
get { return (bool)this["ISError"]; }
set { this["ISError"] = value; }
}
[ConfigurationProperty("ErrorSSN", DefaultValue = @"000000000", IsRequired = true)]
public string ErrorSSN
{
get { return (string)this["ErrorSSN"]; }
set { this["ErrorSSN"] = value; }
}
[ConfigurationProperty("CannedSuccessFilePath", DefaultValue = @"\CannedReports\TU.CANNED.SUCCESS.pgp", IsRequired = true)]
public string CannedSuccessFilePath
{
get { return (string)this["CannedSuccessFilePath"]; }
set { this["CannedSuccessFilePath"] = value; }
}
[ConfigurationProperty("CannedErrorFilePath", DefaultValue = @"\CannedReports\TU.CANNED.ERROR.pgp", IsRequired = true)]
public string CannedErrorFilePath
{
get { return (string)this["CannedErrorFilePath"]; }
set { this["CannedErrorFilePath"] = value; }
}
}
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
indian143 wrote: What is the vshost.exe.config file.
That's the config file used while running the app from within Visual Studio.
What happens when you run the program from the exe in the debug directory directly, rather than from within VS? Same error?
|
|
|
|
|
How to run the program in the debug directory directly. I dont know how to run it in that way. Can you please help me or give me some idea?
Thanks a lot.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Go to C:\DEV\QUTU\Apps\QuarterlyUpdate\Ftg.Systems.QUTransUnionDataViewer\bin\Debug\ in Explorer and doubleclick
Ftg.Systems.QUTransUnionDataViewer.exe
The reason I asked is that sometimes paths in the config files will behave differently when run normally as opposed to being run is the debugger, especially if you use any System paths (doesn't look like that's the case here, though).
One thing I can say now, though, is if you don't have \CannedReports\TU.CANNED.SUCCESS.pgp and \CannedReports\TU.CANNED.ERROR.pgp also sitting in the debug directory, they won't be found by the program when running from within VisualStudio.
|
|
|
|
|
I have double clicked it still its giving me the same error
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Well, then, it's gone beyond me for the moment.
This http://www.codeproject.com/KB/aspnet/ConfigSections.aspx might help more.
|
|
|
|
|
Where did you put your CongifurationHandler class? Is it in a separate assembly (.dll) or is it in the same assembly as your app?
|
|
|
|
|
Hello. I need to develop an sms application to send sms to all customers phone numbers immediately an item comes into stock. Please i need to understand the basics. How to cut out sms resellers and develop my own. please its important and urgent.
Thank you for your anticipated response and clear help.\
kind regards
hassan
stay jacking
|
|
|
|
|
|
Don't cross post, you have asked the same question in the C# forum.
|
|
|
|
|
hi
I want read the file base64 and show on the image control
thanks
|
|
|
|
|
Use a generic handler to read the base64 encoded image , decode it and output it to the browser. Feel free to use Session or Request to pass parameters to the handler to determine which file to read.
If you use ASP.NET 4 you can use the very convenient MemoryStream.CopyTo()-method, in versions below you'll have to do the copying yourself.
In your webform you can use it like this: <asp:Image ImageUrl="Base64ImageHandler.ashx" runat="server" /> (using the HTML img-element works too ofcourse)
<%@ WebHandler Language="C#" Class="Base64ImageHandler" %>
using System;
using System.Web;
using System.IO;
public class Base64ImageHandler : IHttpHandler {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "image/jpeg";
string data64 = File.ReadAllText(@"e:\flotspe\www\images\5base64.txt");
byte[] data = Convert.FromBase64String(data64);
using (MemoryStream ms=new MemoryStream(data)) {
ms.CopyTo(context.Response.OutputStream);
}
}
public bool IsReusable {
get {
return false;
}
}
private static void CopyStream(Stream input, Stream output) {
byte[] buffer = new byte[32768];
while (true) {
int read = input.Read(buffer, 0, buffer.Length);
if (read <= 0)
return;
output.Write(buffer, 0, read);
}
}
}
|
|
|
|
|
As an alternative to using a generic handler you could also embed the base64-code directly into the src-attribute of the img element.
trivial example:
using System;
using System.IO;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e) {
string data64 = File.ReadAllText(@"e:\flotspe\www\images\5base64.txt");
this.form1.Controls.Add(new Image() { ImageUrl = string.Format("data:image/jpg;base64,{0}",data64) });
}
}
for more information about data URI scheme's see http://en.wikipedia.org/wiki/Data:_URI_scheme[^]
|
|
|
|
|
I am making simple board by using gridview.
gridview support page index and this function is good.
I am setting PageSize to 10.
1.
I want to add function which can move first page and last page.(<, >)
For example <(move first page) 1 2 3 4 >(move last page)
2. if pageSize is 2, and result row number is 100.
Pageindex will have many. such like blow.
1 2 3 4 5 6 7 8 9 10...
So i want to show 5 index such as 1 2 3 4 5 >
Is it possible?
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
buffering83 wrote: Is it possible?
Yes it is possible.
You need to create your own pager template (user control).
There are lot of good Article about paging here in Code Project.
Best luck.
|
|
|
|
|
hi
I want create html file form aspx file
|
|
|
|
|
Hi,
try this code below, if your page name is "signin.aspx" than
StringWriter sw = new StringWriter();
HttpContext.Current.Server.Execute("~/signin.aspx",sw,true);
String renderedHtml=sw.ToString();
|
|
|
|
|
Perhaps if you explained what is you are trying to accomplish we could assist you better.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I am sorry for asking such an obvious question, and (frustratingly) I KNOW what I am looking for is on this website somewhere already, but could anyone be good enough to point me at a good article for writing a base page class for an ASP.NET base page?
Best wishes, Patrick
|
|
|
|
|
Have a look these links. Might be useful.
Link 1[^]
Link 2[^]
Regards,
TweakBird
***** Posted 50000th post in GIT O_O ******
|
|
|
|
|
Patrick Skelton wrote: I am looking for is on this website
I guess you missed this "on this website"
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: you missed this "on this website"
Yes. I missed it.
Regards,
TweakBird
***** Posted 50000th post in GIT O_O ******
|
|
|
|
|